View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 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