PC Review


Reply
Thread Tools Rate Thread

autorun macro from access

 
 
=?Utf-8?B?RGFuaWVsIE0=?=
Guest
Posts: n/a
 
      19th Nov 2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoRun Macro with a delay to give user the choice to cancel the macro wanderlust Microsoft Excel Programming 3 20th Oct 2011 09:01 PM
autorun macro without opening access Tracy Microsoft Access Macros 1 24th Mar 2006 10:53 PM
Autorun Macro Roy B Microsoft Powerpoint 1 15th Nov 2004 10:17 AM
Autorun macro MikeM Microsoft Excel Discussion 3 7th Oct 2004 10:40 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Microsoft Excel Programming 2 25th May 2004 06:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.