Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Workbook reopens after close

John,
did you forget to post your code?
Catherine

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort not saved across saves/reopens Shane Devenshire Excel Worksheet Functions 1 March 17th 09 08:03 PM
Help on Workbook close and workbook save events Adam Harding Excel Programming 1 September 29th 05 04:12 PM
Close Workbook Mike Jenkins Excel Programming 1 May 3rd 05 12:48 PM
Before Close workbook? Marc[_20_] Excel Programming 1 March 18th 05 07:19 PM
Close a the current workbook and load another specified workbook Adrian[_7_] Excel Programming 4 August 7th 04 05:29 PM


All times are GMT +1. The time now is 12:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"