Hi, I am trying to run an excel macro from within an automated access macro. Through some VB code I got from another forum I was able to write what I thought was a macro in Access that does the job, however it has saved as a module. I have not yet taken Visual Basic (start on April 7) so I don't really understand the difference between a macro and a module. My dilemma at this point is to get this module to run from within the access macro I am using, I have a command for OpenModule but that doesn't run it, I thought perhaps RunCode but that doesn't seem to do the trick. I have included the code below, any help is appreciated
Sub testx()
Dim oEx As Object
Set oEx = CreateObject("Excel.Application")
' oEx.Visible = True
oEx.Workbooks.Open "c:\vb.xls"
oEx.Run "Macro1"
oEx.Quit
Set oEx = Nothing
End Sub
Sub testx()
Dim oEx As Object
Set oEx = CreateObject("Excel.Application")
' oEx.Visible = True
oEx.Workbooks.Open "c:\vb.xls"
oEx.Run "Macro1"
oEx.Quit
Set oEx = Nothing
End Sub