Start Excel inside MSaccess with a makro

L

Lars

Hi
here is another problem i have been grounded with...
This code example is what my poor knowledge in VBA have let me done so
far...
The option_click is done with a clickbutton in MsAccess
/thanks
Lars

-------------------- "" -------------------""-----------------------

Option Compare Database
'------------------------------------------------------------
' With a Click button
' Start Excel inside MsAccess and start autom. a Makro when Excel executes
' I have used the Makro funktion inside Msaccess to start Excel
' and it starts with
' Function and after that a Shell is open
' I dont get the Code working that will start my Excel makro autom
' The code module would be something like this I guess
'--------------------
Private Sub Kommandoknapp6_Click()

'------------------------------------------------------------
' Makro1
'
'------------------------------------------------------------
Function Makro1()
On Error GoTo Makro1_Err

Call Shell("Excel.exe c:\dbcq\bok1.xls", 1)
'------------------------------------------------------------
' Here comes the tricky part to invoke the makro
'------------------------------------------------------------
Call Shell("Makro1")

Makro1_Exit:
Exit Function

Makro1_Err:
MsgBox Error$
Resume Makro1_Exit

End Function

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top