#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Moving Code

I have a series of workbooks that are being created through a VBA tool.

In each of these workbooks, I need to place code that will execute upon
their opening and thus I need code in the This Workbook.

I've tried to think of a way to do this by moving a worksheet from my
tool into the new workbooks, but I can't seem to find a way.

Am I better off having the code in another file that my tool opens,
customizes the data in, and then closes? If so, how do I can I
temporarily turn off the code in that file while my tool dumps data and
formats in then turn it back on so that when a user opens that file,
the code executes as it should.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Moving Code

application.EnableEvents = False
' open the workbook
' process the workbook
' close the workbook
Application.EnableEvents = True

--
Regards,
Tom Ogilvy

" wrote in message
oups.com...
I have a series of workbooks that are being created through a VBA tool.

In each of these workbooks, I need to place code that will execute upon
their opening and thus I need code in the This Workbook.

I've tried to think of a way to do this by moving a worksheet from my
tool into the new workbooks, but I can't seem to find a way.

Am I better off having the code in another file that my tool opens,
customizes the data in, and then closes? If so, how do I can I
temporarily turn off the code in that file while my tool dumps data and
formats in then turn it back on so that when a user opens that file,
the code executes as it should.



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
CODE 4 MOVING WITHIN A RANGE-TAB FARAZ QURESHI Excel Discussion (Misc queries) 0 December 5th 07 10:23 AM
Arrow Keys Moving Window Frame instead of Moving Between Cells nemmex Excel Discussion (Misc queries) 2 April 9th 07 09:08 AM
Code for moving cursor one cell to the right Kate Excel Programming 0 August 25th 04 08:54 PM
Copying/moving code in a macro [email protected] Excel Programming 0 September 18th 03 12:12 AM
Code for moving textbox Phil Perry Excel Programming 2 July 9th 03 03:49 PM


All times are GMT +1. The time now is 08:15 PM.

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"