Hi all,
I am attempting to open a specific program and a specific file from Access. Basically, I've built a form which takes information. Once I've loaded new data into the form, I click a command button which opens Excel and passes the Access information to Excel and saves it. I then want to use a different program to do an analysis on this Excel data. In a similar fashion, I have a command button to open the program (called Spotfire) using the Shell command. However, when I try to pass my file, it opens SpotFire but then tells me that it can't find "C:\Documents". That is, it is not passing the whole file name. If I put a file in the "C:\" directory, it will open it just fine, but I'd like to keep my folder structure as is, without moving or renaming files. Is there a way to open my specified file? The code I have is:
___________________
Private Sub Spotfire_App_Click() 'This opens SpotFire for analysis
On Error GoTo Err_Spotfire_App_Click
'The file I need to pass is: C:\Documents and Settings\AOlszans\My Documents\Medical Attending Information\Patient Log\Pt Log Analysis.dxp
Dim stAppName As String ' this is the path for the program
Dim strFile As String 'this is the path for the file
stAppName = "C:\Program Files\TIBCO\Spotfire\3.0\Spotfire.Dxp.exe"
strFile = "C:\Documents and Settings\AOlszans\My Documents\Medical Attending Information\Patient Log\Pt Log Analysis.dxp"
'This is close but it can't find the appropriate strFile -- it is looking in "C:\" and not in any subroot directories
Call Shell(stAppName & " " & strFile, vbMaximizedFocus)
Exit_Spotfire_App_Click:
Exit Sub
Err_Spotfire_App_Click:
MsgBox Err.Description
Resume Exit_Spotfire_App_Click
End Sub
_______________________
Any help is greatly appreciated.
Tony