I am trying to run the following code via a macro command, but I am not having any luck. Which command should I be using? Runcode or something else?
[Private Sub cmdExcel_Click()
On Error GoTo Err_cmdExcel_Click
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True 'Only XL 97 supports UserControl Property
oApp.Workbooks.Open FileName:="S:\PERSONNEL\RGava\GSA Overnight Job\GSA OV Run"
.xls ""
oApp.Visible = True
On Error Resume Next
oApp.UserControl = True
Exit_cmdExcel_Click:
Exit Sub
Err_cmdExcel_Click:
MsgBox Err.Description
Resume Exit_cmdExcel_Click
End Sub]
Thanks,
Belstoy
[Private Sub cmdExcel_Click()
On Error GoTo Err_cmdExcel_Click
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True 'Only XL 97 supports UserControl Property
oApp.Workbooks.Open FileName:="S:\PERSONNEL\RGava\GSA Overnight Job\GSA OV Run"
.xls ""
oApp.Visible = True
On Error Resume Next
oApp.UserControl = True
Exit_cmdExcel_Click:
Exit Sub
Err_cmdExcel_Click:
MsgBox Err.Description
Resume Exit_cmdExcel_Click
End Sub]
Thanks,
Belstoy