The security warning message from Access will be shown first
which goes
"This file may not be safe. Do you want to open the
file or cancel the
operation". There are three buttons there - Cancel,
Open and More Info.
Usually when I click "Open", the database will be
shown.
The VBA code will show the warning message, but after I
click "Open".
The database will be shown for a fleeting second and then
totally
disappear. It looked as if it was opened and then closed by
the program.
But there is nothing in the code that will close the Access
Application,
which puzzles me.
-----Original Message-----
From: MS Excel General Q & A List [mailto:EXCEL-G PEACH.EASE.LSOFT.COM]
On Behalf Of Derby Dad
Sent: Monday, April 16, 2007 11:26 AM
To: EXCEL-G PEACH.EASE.LSOFT.COM
Subject: Re: How to launch Access from Excel VBA - Debug
Help!!!
Can you tell us what "stopped working" means?
What kind of errors or results are you seeing?
On Mon, 16 Apr 2007 11:23:01 -0500, Zong, David B
<DZong AMEREN.COM>
wrote:
>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
------------------------------------------------------------
------------
--
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
*******************************
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
|