LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Links to Local Drive Instead of Same Folder TKS_Mark Excel Discussion (Misc queries) 1 May 21st 09 06:07 AM
Excel in macro and connecting to a network drive question Mike S. Excel Discussion (Misc queries) 3 November 8th 08 02:51 AM
Links to mapped drive change to refer to local hard drive SueD Links and Linking in Excel 1 May 8th 08 11:42 AM
Link workbooks-C drive to network drive Earl Excel Worksheet Functions 0 April 19th 05 05:50 PM
Test whether current drive is local or remote? keepitcool Excel Programming 0 September 2nd 03 10:54 AM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"