Ive written a pretty basic program for work that offers the user a number of
buttons to selct that then open an Excel Template.
The code is basically as shown below, the first section sets the base path
for the Templates and gives the user the option to cahnge should the network
position move. The second part is the code for loading the file on
activation of the corresponding button.
All very simple and functional.
What it doesnt od though is raise an error if the template does not exist.
I would be grateful if someone could give me a clue as to how to go about
this.
Private Sub Menu_Click()
Dim sNewPath As String
sNewPath = InputBox("Enter new location of template files:", ,
"\\agb-dds01\hdd3\Request-templates\")
If Len(Trim(sNewPath)) > 0 Then
m_sBasePath = sNewPath
MsgBox "Base Path changed."
End If
End Sub
Private Sub Command1_Click()
If Right$(m_sBasePath, 1) <> "\" Then
m_sBasePath = m_sBasePath & "\"
End If
ShellEx m_sBasePath & "Static Airbag Template.xlt", , , , "open",
Me.hWnd
Unload Me
End Sub
Drink and drugs cause amnesia and other things I can't remember... Another
meaningless e-mail brought to you by Dave Wateridge PLC. A member of the Sad
Bastard Group
http://uk.geocities.com/da************@btinternet.com/
http://www.btinternet.com/~fratton/