LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default autorun macro from access

I have a macro i have created in excel and I have an access db that i want to
call an excel file run this macro against it.

Now i do not want to run this macro from my personal.xls or have to drop
this in the xlstart folder. what i would like is to just create a macro.xls
file with the macros in and when i call excel from access open the
"logfile.xls" and run a macro on it from the "macro.xls" file. Alternately if
i can copy the macro from access to excel when opening "logfile.xls" that
would work to.

The logfile.xls comes from another person without any macros in it. i format
the file with my macro and resave it. but i want to do this from access.
further i want to copy this to the server so that anyone can do this by
hitting the command button, so it cannot reside on my local machine.

Any ideas?

I have the following code in access but it doesnt even seem to open the file
with my personal.xls.


Private Sub Command3_Click()
Dim objXL As Object, x
On Error Resume Next
Set objXL = CreateObject("Excel.Application")
With objXL.Application
.Visible = True
'Open the Workbook
.Workbooks.Open "C:\testlog.XLS"
.ActiveWorkbook.RunAutoMacros xlAutoOpen
x = .Run("log2sms", 0)
End With
Set objXL = Nothing

End Sub


 
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
AutoRun Macro with a delay to give user the choice to cancel the macro wanderlust Excel Programming 2 September 28th 07 04:09 PM
Autorun macro Kelly Excel Worksheet Functions 1 January 18th 06 04:03 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
Autorun Macro RK[_3_] Excel Programming 2 February 26th 04 12:15 PM
autorun a macro Reab Excel Programming 1 November 28th 03 09:42 PM


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