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 Access trying to call up an Excel 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
Its not working though. Any ideas as to what I'm doing wrong?
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
Its not working though. Any ideas as to what I'm doing wrong?