View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joel Mills Joel Mills is offline
external usenet poster
 
Posts: 79
Default Userform Local Drive & Network drive question

I have a userform with two command buttons assigned to the following macros.
The user should be able to run the appropriate macro depending on the
location of a file, either on the local drive "C:\" or the Network drive.
After changing the current drive and running the macro a second time the
drive remains the one previously selected. Could someone please revise this
code to select the location of the Lotus File?


Sub ExportLocal()
CurDrive = "C:\"
ChDir "C:\P3WIN\PROJECTS"
Dim MyFile As String
MyFile = Application.GetOpenFilename("Lotus 1-2-3 Files (*.wk?),*.wk?")
'Stop here if all you want is the path and file name - it's in the
'MyFile variable. 'Continue if you want to open it.
If MyFile = False Then End
Workbooks.Open (MyFile)
End Sub
Sub ExportNetwork()
CurDrive = "\\Bayltdest\Common2\Planning"
ChDir "\Shared Projects"
Dim MyFile As String
MyFile = Application.GetOpenFilename("Lotus 1-2-3 Files (*.wk?),*.wk?")
'Stop here if all you want is the path and file name - it's in the
'MyFile variable. 'Continue if you want to open it.
If MyFile = False Then End
Workbooks.Open (MyFile)
End Sub