Hi,
If you put the Excel macro in your Workbook_Open() event, it should automatically execute when the spreadsheet is opened.
In order to run Excel VBA from within Access(different from what I put above), you need to call the Excel library as the first procedure in your Access macro, like:<pre>Sub ExcelMacro()
Call MakeLibrary_Excel
Excel code
Excel code
Excel code
End Sub</pre>
I don't know the exact code for this, but it will probably look something like:<pre>Sub MakeLibrary_Excel()
On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{00020905-0000-0000-C000-000000000046}", 8, 0
End Sub</pre>
The above reference is used to execute Word VBA from within Excel. I'd be very interested to see the equivelent code for executing Excel VBA from within Access, though I don't think its necessary for your situation.
HTH,
Corticus
This message was edited by Corticus on 2002-12-31 12:15