List Info

Thread: How to launch Access from Excel VBA - Debug Help!!!




How to launch Access from Excel VBA - Debug Help!!!
user name
2007-04-16 11:23:01
Hi, all:

I tried to open Access through a button in Excel. I can not
figure out
why the following codes stopped working after it worked for
a while. Can
anyone figure it out? 

Thanks


Sub Open_Access()
Application.DisplayAlerts = False
' Initialize string to database path.
Const strPath = "G:MarketMarketPersonalDavidMy
Shared Datasource"
strDB = strPath & "David Database.mdb"
' Create new instance of Microsoft Access.
Set appAccess =
CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB
appAccess.Visible = True
'appAccess.DoCmd.OpenForm "Formnameabc"
End Sub

The References chosen are:
*Visual Basic For Applications
*Microsoft Excel 11.0 Object Library
*OLE Automation
*Microsoft Office 11.0 Object Library

David

*******************************
The information contained in this message may be privileged
and/or confidential and protected from disclosure. If the
reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to
the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication
is strictly prohibited. Note that any views or opinions
presented in this message are solely those of the author and
do not necessarily represent those of Ameren. All emails are
subject to monitoring and archival. Finally, the recipient
should check this message and any attachments for the
presence of viruses. Ameren accepts no liability for any
damage caused by any virus transmitted by this email. If you
have received this in error, please notify the sender
immediately by replying to the message and deleting the
material from any computer. Ameren Corporation
*******************************

------------------------------------------------------------
--------------
The EXCEL-G list is hosted on a Windows NT(TM) machine
running L-Soft
international's LISTSERV(R) software.  For
subscription/signoff info
and archives, see htt
p://peach.ease.lsoft.com/archives/excel-g.html .
                             COPYRIGHT INFO:
http://peach.ease.lsoft.com/scripts/wa
.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )