Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Kick off access using excel.

Hi,

I am trying to start access using excel and run a macro. There are two
problems.

1.) I get an error when I try to open access on the "Y:" drive. The Y drive
is a shared drive at work that I have access to. My hard drive is drive "C:"

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
Y:\Building.mdb")

Error Message = ...
'The command line you used to start Microsoft Office Access contains an
option that microsoft Office Acess doesn't recognize.
'Exit and restart Microsoft Office Access using valid command-line options.

2.) Do you know the syntax to use to start "Macro1" in the database?


Thanks for your help!!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Kick off access using excel.

One other thing. I get the same error when I copy the database to the C:
drive so the code reads.

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
C:\Building.mdb")


Error message is the same .


"Jeff" wrote:

Hi,

I am trying to start access using excel and run a macro. There are two
problems.

1.) I get an error when I try to open access on the "Y:" drive. The Y drive
is a shared drive at work that I have access to. My hard drive is drive "C:"

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
Y:\Building.mdb")

Error Message = ...
'The command line you used to start Microsoft Office Access contains an
option that microsoft Office Acess doesn't recognize.
'Exit and restart Microsoft Office Access using valid command-line options.

2.) Do you know the syntax to use to start "Macro1" in the database?


Thanks for your help!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 638
Default Kick off access using excel.

Sub tryThis()
Dim objAcc As Object
On Error GoTo ender
Set objAcc = CreateObject("Access.Application")
objAcc.OpenCurrentDatabase _
"Y:\Building.mdb"
objAcc.Visible = True
With objAcc
.DoCmd.RunMacro ("Macro1")
End With
closer:
Set objAcc = Nothing
Exit Sub
ender:
MsgBox Err.Description
Resume closer
End Sub

Jeff wrote:
One other thing. I get the same error when I copy the database to the C:
drive so the code reads.

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
C:\Building.mdb")


Error message is the same .


"Jeff" wrote:

Hi,

I am trying to start access using excel and run a macro. There are two
problems.

1.) I get an error when I try to open access on the "Y:" drive. The Y drive
is a shared drive at work that I have access to. My hard drive is drive "C:"

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
Y:\Building.mdb")

Error Message = ...
'The command line you used to start Microsoft Office Access contains an
option that microsoft Office Acess doesn't recognize.
'Exit and restart Microsoft Office Access using valid command-line options.

2.) Do you know the syntax to use to start "Macro1" in the database?


Thanks for your help!!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Kick off access using excel.

Wow! thanks for your help. What would I do without you guys.



"JW" wrote:

Sub tryThis()
Dim objAcc As Object
On Error GoTo ender
Set objAcc = CreateObject("Access.Application")
objAcc.OpenCurrentDatabase _
"Y:\Building.mdb"
objAcc.Visible = True
With objAcc
.DoCmd.RunMacro ("Macro1")
End With
closer:
Set objAcc = Nothing
Exit Sub
ender:
MsgBox Err.Description
Resume closer
End Sub

Jeff wrote:
One other thing. I get the same error when I copy the database to the C:
drive so the code reads.

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
C:\Building.mdb")


Error message is the same .


"Jeff" wrote:

Hi,

I am trying to start access using excel and run a macro. There are two
problems.

1.) I get an error when I try to open access on the "Y:" drive. The Y drive
is a shared drive at work that I have access to. My hard drive is drive "C:"

Call Shell("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
Y:\Building.mdb")

Error Message = ...
'The command line you used to start Microsoft Office Access contains an
option that microsoft Office Acess doesn't recognize.
'Exit and restart Microsoft Office Access using valid command-line options.

2.) Do you know the syntax to use to start "Macro1" in the database?


Thanks for your help!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code to kick off macro when workbook command to close is initi zulfer7 Excel Discussion (Misc queries) 2 June 23rd 06 08:04 PM
Excel vs. Access [email protected] Excel Discussion (Misc queries) 9 June 10th 06 12:46 AM
Access to Excel tiab86 Excel Worksheet Functions 2 April 7th 06 03:51 PM
Access Form In An Access Report (SubForm) Question Gary Links and Linking in Excel 0 January 27th 06 05:54 AM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"