Opening Excel from the switchboard

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I need to open an Excel spreadsheet from a switchboard
button. Is there any way to do this?

Thanks,
Michelle
 
Yes. You could use code similar to this in the OnClick event of the
switchboard button:

Private Sub cmdButtonName_Click()
Dim xlApplication As Object
Set xlApplication = CreateObject("Excel.Application")
xlApplication.Visible = True
End Sub
 
Ken Snell said:
Yes. You could use code similar to this in the OnClick event of the
switchboard button:

Private Sub cmdButtonName_Click()
Dim xlApplication As Object
Set xlApplication = CreateObject("Excel.Application")
xlApplication.Visible = True
End Sub

You could also trythe following as the On Click code :


Private Sub cmdButtonName_Click()

Call Shell("C:\PathToExcel\Excel.exe""C:\PathToMyExcelFile.xls""", 1)

End Sub


You need to put the full path to the Excel.exe file in along with the full
path to your spreadsheet. Leave the quotation marks where they are and that
will deal with any spaces in the path names.

HTH

Raist.
 
Back
Top