Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping macros running?
Hi all,
I've been looking everywhere for a solution to this without any luck. I've got an access database that opens a excel spreadsheet (via VBA) and collects infomation about the shapes on the spreadsheet and puts the infomation on a form in Access. All the code to do this is ok, but i can't close down Excel afterwards. I did the usual .quit method and set the object to nothing but it still showed in the process manager. I was just about to give up when i found that it was crashing because there was a routine running on the workbook_deactivate & workbook_beforeclose events. Is there anyway to stop these from running on shut down, without changing the original spreadsheets (i can't as there are too many of them!) I'm using Access & Excel 97. I wish there was a "oWb.open "c:\spreadsheet.xls" RunMacros:=False" option!! Thanks for your help Ben Vince |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping macros running?
Set xlApp.application.enableevents = false before the workbook close or the
quit. -- HTH RP (remove nothere from the email address if mailing direct) "Ben Vince UK" wrote in message oups.com... Hi all, I've been looking everywhere for a solution to this without any luck. I've got an access database that opens a excel spreadsheet (via VBA) and collects infomation about the shapes on the spreadsheet and puts the infomation on a form in Access. All the code to do this is ok, but i can't close down Excel afterwards. I did the usual .quit method and set the object to nothing but it still showed in the process manager. I was just about to give up when i found that it was crashing because there was a routine running on the workbook_deactivate & workbook_beforeclose events. Is there anyway to stop these from running on shut down, without changing the original spreadsheets (i can't as there are too many of them!) I'm using Access & Excel 97. I wish there was a "oWb.open "c:\spreadsheet.xls" RunMacros:=False" option!! Thanks for your help Ben Vince |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping macros running?
You can turn off Excel events via the Application object.
AppExcel.EnableEvents = False ' open the workbook AppExcel.EnableEvents = True where AppExcel is your reference to the Excel Application object. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ben Vince UK" wrote in message oups.com... Hi all, I've been looking everywhere for a solution to this without any luck. I've got an access database that opens a excel spreadsheet (via VBA) and collects infomation about the shapes on the spreadsheet and puts the infomation on a form in Access. All the code to do this is ok, but i can't close down Excel afterwards. I did the usual .quit method and set the object to nothing but it still showed in the process manager. I was just about to give up when i found that it was crashing because there was a routine running on the workbook_deactivate & workbook_beforeclose events. Is there anyway to stop these from running on shut down, without changing the original spreadsheets (i can't as there are too many of them!) I'm using Access & Excel 97. I wish there was a "oWb.open "c:\spreadsheet.xls" RunMacros:=False" option!! Thanks for your help Ben Vince |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
stopping the link of macros in one workbook with every other exce. | Excel Discussion (Misc queries) | |||
stopping the link of macros in one workbook with every other exce. | Excel Discussion (Misc queries) | |||
Stopping an excel macro while it is running. | Excel Programming | |||
Stopping Excel after running visual basic in Access | Excel Programming |