Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook reopens after close
I have a some code that uses GetOpenFilename to create an array of
filenames. Then one by one, the file is opened and a range is copied to the orginal master file. After the copy procedure, the file is closed and the next one is opened. This procedure seems to work ok but after it completes, all of of the files seem to open up again. Note the secondary files are copies of the master file that have been sent to others for data collection. Therefore, they contain the same VBA code as the master file. I have a feeling that the presense of identical VBA code in these files may be causing the problem. Any chance the macro is getting confused and picking up execution in one of the other files? Here's a simplified version of my code. When I run it, I check the task bar at the MsgBox and have confirmed the secondary files are no longer loaded. Immediately after clicking ok, those files are reopened. Help. - John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook reopens after close
John,
did you forget to post your code? Catherine |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook reopens after close
Yes, I forgot to post my code but I just figured out the problem. I
had a Workbook_Open event running that included a timer for a short delay. I added disabled events before opening the files and then enabled events after closing the files and all works again. Thanks for looking. - John On Dec 13, 4:17 pm, "John Michl" wrote: I have a some code that uses GetOpenFilename to create an array of filenames. Then one by one, the file is opened and a range is copied to the orginal master file. After the copy procedure, the file is closed and the next one is opened. This procedure seems to work ok but after it completes, all of of the files seem to open up again. Note the secondary files are copies of the master file that have been sent to others for data collection. Therefore, they contain the same VBA code as the master file. I have a feeling that the presense of identical VBA code in these files may be causing the problem. Any chance the macro is getting confused and picking up execution in one of the other files? Here's a simplified version of my code. When I run it, I check the task bar at the MsgBox and have confirmed the secondary files are no longer loaded. Immediately after clicking ok, those files are reopened. Help. - John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sort not saved across saves/reopens | Excel Worksheet Functions | |||
Help on Workbook close and workbook save events | Excel Programming | |||
Close Workbook | Excel Programming | |||
Before Close workbook? | Excel Programming | |||
Close a the current workbook and load another specified workbook | Excel Programming |