View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Paul C Paul C is offline
external usenet poster
 
Posts: 269
Default Dissable Workbook_Open Event in certian cases

Within Excel and Excel VBA

Application.EnableEvents=false will suppress the event triggers and
Application.EnableEvents=true will turn them back on.

Since you are starting in Access you may have to do some fiddling to get
Access code to suppress Excel events. I am not if this line in Access code
will suppress the Excel event and I am not sure of the exact syntax to cross
applications.

Something like xlsApp.EnableEvent=false may work.

Hope this at least points you in the right direction.



--
If this helps, please remember to click yes.


"Michael" wrote:

I have a MS Access routine that opens a whole bunch of Excel models
and sucks data out into a data base. Problem is since I set it up some
of the excel files now have a Workbook_Open event that gets triggered
when Access Opens the workbooks. The event asks for some user input
which I want to avoid when opened by Access.

Is there a way for Excel to tell that it is being opend by VBA in
Access as opposed to the user opening the file?

This is how I am opening the workbooks from Excel
Set xlsApp = CreateObject("Excel.application")
Set wb = xlsApp.Workbooks.Open(Path & Filename, , True)

Any ideas would be appreciated.

Thanks.
.