G
Guest
Hello.
I am using Access 2003 and I have created a button on a form using the
button wizard to open Excel, but I need it to open a particular spreadsheet
located at S:\Expenses\ExpenseForm.xls
Below is the default vba stuff in the Event Procedure for "On Click".
How do I modify it to open this specific spreadsheet?
Private Sub SPC_Form_Click()
On Error GoTo Err_SPC_Form_Click
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True
Exit_SPC_Form_Click:
Exit Sub
Err_SPC_Form_Click:
MsgBox Err.Description
Resume Exit_SPC_Form_Click
End Sub
Thanks.
Iram/mcp
I am using Access 2003 and I have created a button on a form using the
button wizard to open Excel, but I need it to open a particular spreadsheet
located at S:\Expenses\ExpenseForm.xls
Below is the default vba stuff in the Event Procedure for "On Click".
How do I modify it to open this specific spreadsheet?
Private Sub SPC_Form_Click()
On Error GoTo Err_SPC_Form_Click
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True
Exit_SPC_Form_Click:
Exit Sub
Err_SPC_Form_Click:
MsgBox Err.Description
Resume Exit_SPC_Form_Click
End Sub
Thanks.
Iram/mcp