Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stop execution of ThisWorkBook Code


I am using EXCEL 97 and I am adding ThisWorkBook module which ha
WorkBook_Open, _BeforeClose, _BeforeSave, _Activate and _Deactivat
events
declared through Code (using VB application extensibility library)

Application.VBE.VBProjects("YourVBAProject").VBCom ponents("ThisWorkbook").CodeModule.AddFromFil
"FileName.txt"

As soon as the code is copied, it is auto executing. I would like t
stop its execution, close it and reopen it to start execution.

How do I do this

--
Anirba
-----------------------------------------------------------------------
Anirban's Profile: http://www.excelforum.com/member.php...nfo&userid=987
View this thread: http://www.excelforum.com/showthread.php?threadid=31872

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Stop execution of ThisWorkBook Code

In my simple testing (xl2002, though), I couldn't duplicate this.

but maybe you could try:

application.enableevents = false
'your addfromfile code
application.enableevents = true

(the _activate and _deactivate events didn't seem to fire in my testing.)



Anirban wrote:

I am using EXCEL 97 and I am adding ThisWorkBook module which has
WorkBook_Open, _BeforeClose, _BeforeSave, _Activate and _Deactivate
events
declared through Code (using VB application extensibility library)

Application.VBE.VBProjects("YourVBAProject").VBCom ponents("ThisWorkbook").CodeModule.AddFromFile
"FileName.txt"

As soon as the code is copied, it is auto executing. I would like to
stop its execution, close it and reopen it to start execution.

How do I do this?

--
Anirban
------------------------------------------------------------------------
Anirban's Profile: http://www.excelforum.com/member.php...fo&userid=9871
View this thread: http://www.excelforum.com/showthread...hreadid=318724


--

Dave Peterson
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
Stop window saying code execution interrupted at startup? Jerry07 Excel Discussion (Misc queries) 1 August 15th 09 05:16 PM
stop execution al Excel Programming 3 October 2nd 04 01:20 AM
stop code execution with button Al ramirez Excel Programming 0 October 1st 04 06:27 AM
stop code execution al ramirez Excel Programming 1 August 26th 04 03:45 AM
Delete the code in ThisWorkbook Darrin Henry Excel Programming 1 October 1st 03 11:10 PM


All times are GMT +1. The time now is 01:43 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"