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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro in excel2000

Status
Not open for further replies.

dbpcar

Programmer
Mar 1, 2001
39
US
I am trying to write some macros to open several workbooks at a time and I am not having any luck. I have tried all the ways that I can think of to open workbooks, and the macro will not record any keystroke commands. I have done this before in infinite variety and never had a problem. I cannot figure this out. If I write the code out, the first line is saved, everything else disappears when I try to run the macro. Any ideas????:<(
 
The way I have opened files in Excel using VBA code is the following.

Workbooks.Open Filename:=&quot;ADDRESS OF FILE&quot;

Does that help in anayway?

dyarwood
 
Sort of, I think that I am looking at a VBA failure, not just a problem in a single macro. On to plan B. All my inter-workbook macros are being eaten up when I open them.
Thanks for your help.
dbpcar
 
HOw do you mean eaten up? The macros are no longer there after you write them?

dyarwood
 
When you choose 'record macro', check the place where macros are recorded. Can be 'this workbook' - active workbook while selecting 'record macro option' or 'personal macros workbook' - a hidden workbook named 'PERSONAL.XLS', created automatically when first selected this option, silently opening with excel.

combo
 
If you have a fixed set of workbooks to open then look at

File, Save Workspace.

This will save as a workspace file the list of files to be opened together. If you subsequently open the workspace it opens all of the files.
 
I use a master workbook that functions as the open and close point for the macros that run the other workbooks. I have never tried a Save Workspace command, that may be next. But, when I try to use a macro that I know exists in my master workbook, it executes the first one or two commands and the rest don't work. Reviewing the code shows that pieces are missing, even after reentering the code that is lost, it can't be saved. The whole mess makes me think that something in visual basic itself has gone wacky.
I generally write macros that connect several workbooks in a master workbook that serves as the front door. I have looked for the macros in weird places, and so far nothing.
At this point I am ready to toss the computer right out the window!
I'll keep working on this, hopefully one of these suggestions will find my missing sheep!
dbpcar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top