Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Override Start Up Macro when Opening a File from Excel Code

Status
Not open for further replies.

rceddy

Programmer
Joined
Mar 5, 2002
Messages
8
Location
US
I have an Excel 97 file that extracts information from numerous (70 -100) other Excel files. The problem is that our current files have start up code to set the toolbars and close code to paste special some billing information so that it is a hard coded number. I do not need to do these functions when extracting the information for this file. At best it slows the run time down considerably and at worst crashes. Is there a line of code to override this startup and close routines? I know I can open a file while holding down the shift key to override the code but can't find the line of code to do the same thing. Does anyone know how to do this? Thanks.
 
I never managed to work this one myself but two suggestions as ways round it.
On the spreadsheets your reading, have the info saved as files separately when they save, this is much faster to read when pulling the info and gets round the start up problem. It also removes the strict naming and location requirements of the 'child' spreadsheets.
Or, have an If globalvariable = "Don't Boot" Then Exit Sub on the child sheets open macros and on the main spreadsheet, set globalvariable to "Don't Boot" before you open the child sheets. It's a fudge, but it should work.

Using the files does have a lot of advantages tho. A report I pull off from up to 80 spreadsheets, (going up to several hundred shortly), can produce the report in about 5 secs, opening the spreadsheets themselves would take minutes. And you have to rely on the users keepeing the right names and locations.

If you don't feel confident with using files, I did use a method of having inbetween spreadsheets, where the child spreadsheets opened a data sheet and wrote the info to that, that was then opened by the reporting spreadsheet and the data extracted. It worked, but was slow.

Hope some of the above helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top