View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ronald R. Dodge, Jr.[_2_] Ronald R. Dodge, Jr.[_2_] is offline
external usenet poster
 
Posts: 134
Default Excel VB to open Access DB

When opening from another code, it is regardless an object. It would be
wise to assign this object to an object variable declared as an Access
application.

The AutoExec will not run automatically when the DB is opened by another
code. However, you can specifically state it to run after opening up the
DB. Reference point for this statement is the following:

http://www.vb123.com/toolshed/05_map/ch04_autoexec.htm

Look under the sub heading of "How I've used AutoExec Macros" on the very
last line with the Note.


It's just like within Excel, when a workbook is opened from within code,
while the Open Event on the workbook will run automatically provided the
EnableEvents on the Application object is set to True, the private sub of
"Auto_Open" within a standard module will not run automatically within Excel
when the workbook is opened via code. In that case, there would have to be
a public sub setup within the same module as the "Auto_Open" private sub to
run the private sub procedure, and the code opening up that workbook would
then have to run the public sub via the Application.Run method.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Cangioli" wrote in message
...
I'm attempting to get my Excel VB code to open an Access Database.
Everything I try wants to use Access as an object in Excel. I just want
it
to open it. Here's some background.
Excel code is creating data and saving an .xls file I use as an import
into
my Access DB. My DB has an AutoExec command to manipulate and distribute.
I
want the Excel VB to Open the Access DB after it creates my .xls.
Any help is appreciated. Thanks.