Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Links to Local Drive Instead of Same Folder | Excel Discussion (Misc queries) | |||
Excel in macro and connecting to a network drive question | Excel Discussion (Misc queries) | |||
Links to mapped drive change to refer to local hard drive | Links and Linking in Excel | |||
Link workbooks-C drive to network drive | Excel Worksheet Functions | |||
Test whether current drive is local or remote? | Excel Programming |