Access Form command button, run excel file

K

kuslusr1

I trying to set up a Main Form command button that will allow end users to
open an Excel file "W:\Public Access Folders\Misc\SURFACE DEPARTMENT MAXIMO
REPORTS\Availability Calculator.xls". I have tried a few different methods
that I found in the Community Forum with no luck. Hoping someone might have a
procedure example that would work for me.
 
F

fredg

I trying to set up a Main Form command button that will allow end users to
open an Excel file "W:\Public Access Folders\Misc\SURFACE DEPARTMENT MAXIMO
REPORTS\Availability Calculator.xls". I have tried a few different methods
that I found in the Community Forum with no luck. Hoping someone might have a
procedure example that would work for me.

Application.FollowHyperlink "W:\Public Access Folders\Misc\SURFACE
DEPARTMENT MAXIMO REPORTS\Availability Calculator.xls"
 
K

kuslusr1

I was using the following code to open Excel:
Private Sub Command449_Click()
On Error GoTo Err_Command449_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_Command449_Click:
Exit Sub
Err_Command449_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command449_Click
End Sub

How to I apply the code provided below to open the identified excel file.

Application.FollowHyperlink "W:\Public Access Folders\Misc\SURFACE
DEPARTMENT MAXIMO REPORTS\Availability Calculator.xls"
 
F

fredg

I was using the following code to open Excel:
Private Sub Command449_Click()
On Error GoTo Err_Command449_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_Command449_Click:
Exit Sub
Err_Command449_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command449_Click
End Sub

How to I apply the code provided below to open the identified excel file.

Application.FollowHyperlink "W:\Public Access Folders\Misc\SURFACE
DEPARTMENT MAXIMO REPORTS\Availability Calculator.xls"


Private Sub Command449_Click()
On Error GoTo Err_Command449_Click

Application.FollowHyperlink "W:\Public Access Folders\Misc\SURFACE
DEPARTMENT MAXIMO REPORTS\Availability Calculator.xls"

Exit_Command449_Click:
Exit Sub
Err_Command449_Click:
MsgBox "Error #: " & Err.Number & " " & Err.DESCRIPTION
Resume Exit_Command449_Click
End Sub


Note: the code should be all on one line.
Also, I've added the error number to your Error handling code. Often
times the error number is more important than the error description.
 

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