Opening Excel from the switchboard

M

Michelle

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

Thanks,
Michelle
 
K

Ken Snell

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
 
R

Raistlin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top