Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to comp.databases.ms-access,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default access 97 to excel 97: execute macro automation

Assuming macro1 is a vba macro rather than a Excel4 style macro on an Excel4
macro sheet change this line

appExcel.ExecuteExcel4Macro "Macro1"

to

appExcel.Run "macro-test.xls!Macro1"

Regards,
Tom Ogilvy


JMCN wrote in message
om...
hello

i am trying to open an excel worksheet and excute a macro. i am able
to launch excel but i cannot execute the macro(s). why? what did i
leave out? should i create a getobject function? suggestions would be
appreciated:)
thanks jung

here is the code.

Public Sub LaunchExcel()
Dim appExcel As Excel.Application, strwks As String
Set appExcel = CreateObject("Excel.Application")
Msg "Excel is running"
appExcel.Visible = True
strwks = "c:\Program Files\Microsoft Office\Office\"
strwks = strwks & "macro-test.xls"
appExcel.ExecuteExcel4Macro "Macro1"
Set appExcel = Nothing
End Sub



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
FIX: Annoying inconsistent errors in Excel via Access automation [email protected] Excel Discussion (Misc queries) 0 September 23rd 08 01:36 PM
Automation to Excel from Access Bob Barnes Excel Discussion (Misc queries) 1 February 11th 08 05:18 AM
Running Access-to-Excel Automation.... Bob Barnes Excel Discussion (Misc queries) 2 June 16th 06 08:57 PM
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. Daniel Excel Worksheet Functions 1 June 24th 05 02:59 PM


All times are GMT +1. The time now is 04:38 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"