Joshua61679
Technical User
I'm kind of new to VBA programming. I've been using Access for about a year, but have avoided VBA 'till now. I'm in Access2002 trying to call up an Excel2002 worksheet named "simplecasedhole.xls" in the c:\ directory when a command button is clicked. This is the code I'm using:
Private Sub Done_Click(Path As String)
Dim xlApp As Excel.Application
If Dir(Path) = "" Then
MsgBox Path & " isn't a valid path!"
Exit Sub
Else
Set xlApp = CreateObject("Excel.Application"
xlApp.Visible = True
xlApp.Workbooks.Open "C:\simplecasedhole.xls"
End If
End Sub
I'm getting an error message that says "The event On Click that you entered as the event property setting produced the following error: procedure declaration does not match description of event or procedure having same name." Any help would be much appreciated.
Private Sub Done_Click(Path As String)
Dim xlApp As Excel.Application
If Dir(Path) = "" Then
MsgBox Path & " isn't a valid path!"
Exit Sub
Else
Set xlApp = CreateObject("Excel.Application"
xlApp.Visible = True
xlApp.Workbooks.Open "C:\simplecasedhole.xls"
End If
End Sub
I'm getting an error message that says "The event On Click that you entered as the event property setting produced the following error: procedure declaration does not match description of event or procedure having same name." Any help would be much appreciated.