Workbooks Take Long Time To Activate When Vb Editor Is Open

Mar 17, 2007

I have the VB Editor open and am manually activating different workbooks in Excel (with 20/25 modules each), the VB Editor goes through a process of maximising each and every module in the workbook I have selected before I can edit any code or, indeed, do anything in the workbook. This process takes about 8-10 seconds every time I select a different workbook in excel! I have played around with the settings "Full Module View" in the options section of the VB editor, but to no effect.

View 3 Replies


ADVERTISEMENT

Workbooks.Open Does Not Activate The Workbook

Nov 5, 2008

I have a workbook containing macros that opens a second one (no macros) and does some 'data mining'.

The following VBA is used for that (I use this code on dozen of files and it has always worked, except here):

Set WshShell = CreateObject("WScript.Shell")
ChDir (WshShell.SpecialFolders("MyDocuments"))
BladNaam = Application.GetOpenFilename("Excel File, *.xls", , "Excel")
Workbooks.Open FileName:=BladNaam
TabNaam = ActiveSheet.Name

The problem is that most of the time the newly opened workbook is NOT activated (i.e put on top) and thus the rest of the code is executed on the wrong workbook...

If I put in a Msgbox(ActiveWorkbook.Name) 9 out of 10 times the active workbook is the initial one and not the one that was opened by the code.

tried replacing Active.Workbook with wb (dim wb as workbook).
tried to wait-a-few-seconds in between code
tried renaming

View 9 Replies View Related

Spreadsheet Taking A Long Time To Open

May 28, 2009

I have a couple shreadsheets I have created, one is for Purchase order's and has 4 different sheets. with one sheet holding addresses linked a drop down menu in the first sheet, all in the same workbook. Also there is a macro within this sheet to print to a specific printer, and a specific number of copies when CTRL p is pressed. The total file size is approx 9 mb. Opening this file takes approx 30 to 45 seconds. There are no links to any outside files, only links within the workbook itself.

The second File I have recently started having problems with (Our Quotation log) is A workbook containing 3 sheets, 2 sheets independant and one sheet linked to the second that Summarizes the first and also has cels to enter information on the person the quotation has come from. I have this sheet formatted as a table so I can sort by name etc when doing followups.

This workbook also takes approx 30 to 45 seconds to open, and on occasion longer. All workbooks are stored on my computer. The PO workbook has had the problem since I created it, although the Quotation log workbook has only had the issue this week.

View 4 Replies View Related

Large File Takes Long Time To Open/Save

May 19, 2008

I have a large Excel 2007 file, around 60.000KB. 54.000KB are due to one of the worksheets where I have 8760rows x 160columns with data. The calculation time is not a problem, it is very fast, it only takes 2/3 seconds. The problem is when I open or save the file, it takes around 2 minutes... it is not too much, but it becomes too long when one has to open and save it several times. It there any trick to decrease the time when openning or saving an excel file??

View 3 Replies View Related

Open Multiple Protected Workbooks One Time

Dec 23, 2011

I'm looking for some way to open multiple protected workbooks in one time, these workbooks has been protected , but all with the same password. usually, when i open one workbook, open ,enter password, but there are so many of them that i want to open all these workbooks in the same time, the problem is each workbook showed a enter-password box, it so inefficient, i want all these protected workbooks show only one enter-password box.

View 2 Replies View Related

Open Notepad Editor

Dec 20, 2008

What would be a code to open notepad and paste infomation from column cells A3 to A30 when ever a command button is clicked.

View 9 Replies View Related

Don't Open The VB Editor When A Macro Is Executed

May 19, 2008

I have a query in Excel 2003.

My question is:
I have a macro created for my Excel. I have a short cut key to run this macro. When i run the macro, the VB editor is opened where i have written the code. My requirement is, I don't want the VB editor to be opened when i run the macro. I want the macro to be executed but the VB editor should not be visible to the user.

View 9 Replies View Related

How To Open Rich Text Editor In Excel

Dec 1, 2011

I am working on a report where if an icon or button is clicked it should open rich text editor or text box with current date and time in the box so that the managers can enter their remarks next to them. On clicking submit it should save the remarks and next time when opened it must have previous comments with date and also should prompt todays date for new comments.

View 2 Replies View Related

Macro Has Errors If Visual Basic Editor Is Not Open

Nov 12, 2009

I've been helping another user create a workbook that dynamically adds, renames and deletes worksheets from a "Main Sheet".

I have got the whole thing figured out and running to satisfaction, except...

The macro runs fine if the Visual Basic Editor is open. If the editor is closed while the macro is run, I get "Runtime Error '9': Subscript out of range"

Any ideas what could be casing this? The errors occur when attempting to add sheets.

View 2 Replies View Related

Check To See If File Is Open, And If It Is Open, Activate It

May 14, 2009

I have two workbooks. One is a no-nonsense form interface that my bosses will use to enter safety information. I'll call this workbook "Form". This file is stored locally on each of their computers. The other workbook is stored on a common drive. I'll call it "Master".

When my bosses fill out the Form and click "Submit", the Master file is opened, and certain cells are populated based on information entered in the Form. This is the code I am using to make this happen:

View 5 Replies View Related

Switching Between Workbooks Without Having To Use The Activate Command

Jun 22, 2009

Is there a way to switch back and forth between workbooks without having to use the Activate command? I have everything planned out but this aspect is still a source of confusion. The Project: I need to have qty purchased and price in a table from Worksheet B entered into the matching customer index location in Worksheet A. Worksheet B contains customer number, sku, qty purchased and price. Worksheet A contains customer numbers in row 3 and sku's in column A. Minor data manipulation will need to be done on Worksheet B before before accessing it which I plan to do after opening it in this macro.

View 4 Replies View Related

Storing Long Strings In Workbooks

Mar 6, 2009

I need to associate a fairly long (800 characters) string with a workbook as a template SQL query for an ODBC connection. I've thought about putting it into a cell, into a shape, into a standalone VBA module (with some 'magic' to stop it compiling). All I need is to be able to access it fairly easily via VBA (which I'm comfortable with).

View 3 Replies View Related

Activate Another Open Workbook

Aug 15, 2008

I have 2 workbooks open

Book1 has a call to ChangeBook()
Book2 is empty

Function ChangeBook()
Application.Workbooks("Book2.xls").Activate
End Function

ChangeBook() is located in a .xla file loaded on Excel launch.

Calling the function from Book1 does not cause Book2 to activate.

Running the function via the F5 key in the IDE works fine.

I am modifying existing routines that have problems and being able to activate certain books at will would make the changes much easier.

View 9 Replies View Related

Activate Sheet After Open Workbook..?

Jan 26, 2010

On a command button in a userform, I have this code to open another workbook:

View 2 Replies View Related

Activate Sheet And Disable Tabs On Open

Dec 6, 2008

I am trying to create an event macro that would deactivate column and row headers when the workbook is launched and activate a sheet. i am not managing to do this,

View 2 Replies View Related

Activate Open Workbook From Cell Reference

Aug 20, 2008

activate an open workbook based on the workbook name that is typed into a cell that is a named range?

So, I keep wanting to do this:
Windows.Activate Filename:=Range("MyRange")

Because this works:
Workbooks.Open Filename:=Range("MyRange")

View 9 Replies View Related

How Can I Activate An Open Workbook By Macro In Seperate Instances

Feb 24, 2009

I have a program that has all Excel Workbooks in seperate instances of Excel. There is a very sound reason for doing this.

The user has maybe 3 to 10 workbooks open. There are times when a workbook is active and has a Macro Link to open one of the already open workbooks.

When the user clicks the link, they naturally get an error message stating that the workbook is already open. Then they have to close the error msg and click on the Macrosoft Tab and look thru the list of open workbooks and then click the one they are looking for. Additionally, in this Menu Program the user really doesn't even have to know the name of the various workbooks.

I hope everyone will believe me when I state that this program works berautifully.

Right now I am simply cleaning up and making a few little things work better.

QUESTION When the user clicks on a macro link that is to open a workbook that is already open, how - On error - can I have the macro continue on and activate the requested workbook - - - Please remember they are all in separate instances of Excel.

Since the code I'm using can determine if the requested workbook is already open, I think there has to be a way to activate that workbook.

View 14 Replies View Related

Run-time Error 9 On Activate

Nov 2, 2007

Learning VB6 by trial and error from code snippits on the web, however, am embarrassed to say I can't solve this simple one:

Trying to Open an Excel sheet and read it from VB6 code written in another Excel file.

View 12 Replies View Related

Activate Message Box After Time Elapsed

Feb 26, 2012

I have a worksheet with checkboxes in each cell in A11:A110 as well as O11:O110. When a checked, the current time appears in the corresponding cell, using this code for example, A11 :

Private Sub CheckBox1_Click()
*
*** Range("A11").Select
*** ActiveCell.FormulaR1C1 = "=NOW()"
*** Range("A11").Select
*** Selection.Copy
*** Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
******* False, Transpose:=False
*** Range("A11").Select
*** Application.CutCopyMode = False
End Sub

This system is used to track time elapsed. Example, the first event of the day begins, so I click the checkbox in A11 and the time appears in A11. When the event ends, I click the checkbox in O11 and the time appears in O11.

Now what I would like to modify is the following:

After clicking A11, if 30 minutes have elapsed and I still have not checked the end time in O11, I would like the whole row to highlight in red, a pop up message box should advise me that 30 minutes have elapsed. I could click OK and remove the message box. The whole row remains in red highlight until I finally check the checkbox in O11.

Obviously I'd copy the code for each row.

I assume the code goes with the checkbox's code for A11? Also, is it possible for a cell to flash? (highlighted white, then red, then white, red, etc...)

View 1 Replies View Related

Suppress Open Events When Using Workbooks.Open

Dec 3, 2008

I have built a sub that prompts the user for a folder then opens every workbook in the folder 1 at a time to get stats on the contents of each workbook. Worked like a dam until I ran into an unexpected bug. Some of the users built on open events in their workbooks. ...

Right now my routine inventories workbooks to get formula counts, cell counts, most complex formula, highest value... it does this by looping throught the sheets and the cells. If there is a way of obtaining those stats without opening the workbook I may need to rethink a lot of my work.

way to suppress the code in the target workbook I open through workbooks.open

View 9 Replies View Related

Long Calculating Time

Aug 26, 2008

I managed to put together an array formula to calculate the last date that a rep made a sale. It checks two other tabs in the workbook to find the date, and if none is found, it leaves the cell empty.

{=IF(MAXA(IF('Daily Compliance'!A:A=B48,'Daily Compliance'!O:O),IF('Daily Compliance 11-07 to 4-08'!B:B=B48,'Daily Compliance 11-07 to 4-08'!A:A))=0,"",MAXA(IF('Daily Compliance'!A:A=B48,'Daily Compliance'!O:O),IF('Daily Compliance 11-07 to 4-08'!B:B=B48,'Daily Compliance 11-07 to 4-08'!A:A)))}

But it takes sometimes up to 4-5 minutes to make the calculations. Is there possibly a way to simplify it so that it calculates faster, with the same results?

View 3 Replies View Related

Sheetchange Code That Does Not Activate Macro Each Time?

Oct 28, 2012

I am writing a code that has a sheet change event linked to call on a number of macros. The vba works fine until I change another cell and it activates the same macro.

VB:

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range

Select Case Range(BI47)
Case "1"

[Code]....

I have tried if statements and everything else I can find, most will not work, others report errors. The code and macros will be the same on many sheets but work independently and BI27 is the source of the change

View 7 Replies View Related

Converting Long Time Calculation To UDF

Jul 18, 2009

I work with a lot of time based worksheets for a 24/7 operation and constantly use the formula:

=IF($E17>$D17,(HOUR($E17)+(MINUTE($E17)/60))-(HOUR($D17)+(MINUTE($D17)/60)),((HOUR($E17)+24)+(MINUTE($E17)/60))-(HOUR($D17)+(MINUTE($D17)/60)))

to calculate times worked where $D17 is start time and $E17 is finish time. Shifts can start and finish the same day ($E17>$D17) or go past midnight ($D17>$E17).

To make matters even more interesting, there are a number of variables that require adding either "and" and/or "or" conditions to this formula so I can end up with several of these nested and it gets pretty complicated.

I'd like to have a UDF so I can just enter the formula:

=CalcTime(Start Time,Finish Time)

View 9 Replies View Related

Convert Long Date And Time Text To Value

Oct 4, 2013

I have a long date and time text value in a cell such as "2013/10/02 07:43:39.39", where the fractions of a second are very important.

I can use cdate([text]) to convert the text string to a value, but only if i omit the seconds fraction: "2013/10/02 07:43:39".
Otherwise i get a type mismatch error.

Is there any way i can get the whole date/time string converted to a date value? The only way i can think to do it it at the moment is to convert the date/time, then divide the seconds fraction by 86400 and add the 2 values. Is there a better way?

Secondly, i have a large number of these date strings, typically >30k lines x 7 columns. Each string is preceded and trailed by a [space] character.

I can strip these extra spaces no problem. And, i can "loop" to perform it, again no problem. But it's going to take time to perform and i'd rather not if i can avoid it.

View 2 Replies View Related

Code To Time How Long Macro Takes To Run

Mar 10, 2004

Any code I can stick into the end (plus maybe start) of a macro to display the length of time it took for the macro to run?

View 9 Replies View Related

VLOOKUP Performance Is Taking Very Long Time To Recalculate

Jan 11, 2010

I designed a spreadsheet which uses a lot of VLOOKUPs and it takes a very long time to recalculate. I don't know if there is another way I could do this, but this just seemed to make sense and it works just the way we want it but it just takes too long. Here is what the spreadsheet is designed to do:

We have data that is pasted into excel from another source. The data is broken up into account number, date, check number, and amount. Multiple payments from the same account can occur in one month so the data must be totaled. There is a custom function called concatif which works just like sum if but concatenates text. There are VLOOKUPs performed on the account number and the corresponding date, check number, and amount are inserted in the table.

View 3 Replies View Related

Excel File Takes Long Time To Save

Jan 20, 2014

[URL]

Excel takes about 10 minutes in the saving process. When I say 10 minutes, I mean, the excel screen freezes (says not responding) for about 10 minutes, then it actually saves at the very end in the normal time any other file would take as you watch the progress bar go forward.

I know many of the common answers and have tried. reducing the calculation time (which in turn reduces the saving time).

But in my circumstance, the calculation takes a very reasonable amount of time, and you see the progress % going forward.

- I would say I have about 2000 rows, and 15 columns.
- They have sumifs formulas.
- They link to a different workbook.
- The workbook I am working on saves to the network
- the source of my sumifs are also in the same folder on the network
- the recalculation takes about 10 seconds at most
- i have turned off recalculate before saving, it is all on manual calcs

- when i hit save, there are no calcs being performed
- there are no macros in the workbook
- there are only about 2 names in the name manager
- then it freezes for about 10 minutes.
- then the progress bar starts moving then it saves.

What is it doing in those 10 minutes?

1 more item to note, when I break the links to the workbook and thereby removing the sumifs formulas, its a snap.

Why does the existence of the sumifs extend saving time? I would completely understand if it elongated calculation time, but if calculation is off, then why does it even worry about it when saving?

View 4 Replies View Related

Convert Long Number In Cell To Date And Time

May 8, 2009

I have cells of data with a long string of numbers such as: 20090507225836. Is there any easy way to convert them to date/time format, such as below? 5/7/2009 22:58:36

View 5 Replies View Related

Frequency Formula Takes Long Time To Calculate

Feb 12, 2010

I am using the below formula to distinctly count the number of customers that match the criteria that I have in Cells C7 and B10. The data is in a separate worksheet, that I am showing Named Detail of which will be changing on a monthly basis, so a pivot table does not want to be used. The detail data ranges from row 7-40,000, and the file is currently 8610KB's, and can potentially grow.

=SUM(IF(FREQUENCY(IF(Detail!$A$7:$A$40000=C$7,IF(Detail!$B$7:$B$40000=$B10,IF(Detail!$D$7:$D$40000<> "",MATCH(Detail!$D$7:$D$40000,Detail!$D$7:$D$40000,0)))),ROW(Cust)-MIN(ROW(Detail!$D$7:$D$40000))+1),1))

This formula works but takes an excessive amount of time for one caluclation, and I need this for multiple column and row critera. So, can this calculation be changed in order to get the same result with faster calculation time? I am using Excel 2003.

View 6 Replies View Related

Formula Taking Long Time To Get Distinct Word?

Mar 15, 2012

I get distinct word with this formula i have 30,000 rows with below formula taking lot of time with dragging to all cell

{=INDEX(List,MATCH(0,COUNTIF($b$1:b1,List),0))}

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved