Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change curdir to a folder on a network
I would like VBA to change the folder that is displayed when using the
(workbook) OPEN dialog box to a folder that resides on a network drive/computer. let's say the file open dialog box opens to "C:\OldFolder" (and curdir displays "C:\OldFolder" ) let's say I want the file open dialog box to display a folder on a network "\\Newton\c\FolderIWant" chdrive "\\Newton\c" doesn't work chdir "\\Newton\c\FolderIWant" " doesn't work and Application.DefaultFilePath = "\\Newton\c\FolderIWant" msgbox Application.DefaultFilePath does give me "\\Newton\c\FolderIWant" [in the message box] HOWEVER neither curdir nor file open dialog box changes to "\\Newton\c\FolderIWant" They both still are on "C:\OldFolder" What do I do????? Thank you! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change curdir to a folder on a network
I've seen the need to included A LAST "\" in the Path reference,, like:
"\\Newton\c\FolderIWant\" Give that I try.. HTH wrote in message oups.com... I would like VBA to change the folder that is displayed when using the (workbook) OPEN dialog box to a folder that resides on a network drive/computer. let's say the file open dialog box opens to "C:\OldFolder" (and curdir displays "C:\OldFolder" ) let's say I want the file open dialog box to display a folder on a network "\\Newton\c\FolderIWant" chdrive "\\Newton\c" doesn't work chdir "\\Newton\c\FolderIWant" " doesn't work and Application.DefaultFilePath = "\\Newton\c\FolderIWant" msgbox Application.DefaultFilePath does give me "\\Newton\c\FolderIWant" [in the message box] HOWEVER neither curdir nor file open dialog box changes to "\\Newton\c\FolderIWant" They both still are on "C:\OldFolder" What do I do????? Thank you! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change curdir to a folder on a network
Richard,
Try this Private Declare Function SetCurrentDirectoryA _ Lib "kernel32" (ByVal lpPathName As String) As Long Sub SetUNCPath() SetCurrentDirectoryA "\\Newton\c\FolderIWant" End Sub -- HTH Bob Phillips wrote in message oups.com... I would like VBA to change the folder that is displayed when using the (workbook) OPEN dialog box to a folder that resides on a network drive/computer. let's say the file open dialog box opens to "C:\OldFolder" (and curdir displays "C:\OldFolder" ) let's say I want the file open dialog box to display a folder on a network "\\Newton\c\FolderIWant" chdrive "\\Newton\c" doesn't work chdir "\\Newton\c\FolderIWant" " doesn't work and Application.DefaultFilePath = "\\Newton\c\FolderIWant" msgbox Application.DefaultFilePath does give me "\\Newton\c\FolderIWant" [in the message box] HOWEVER neither curdir nor file open dialog box changes to "\\Newton\c\FolderIWant" They both still are on "C:\OldFolder" What do I do????? Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HyperLink to a folder on other drive on the same network (LAN) | Excel Worksheet Functions | |||
Folder Network drive | Excel Discussion (Misc queries) | |||
SetUp Templates in Network Folder | Setting up and Configuration of Excel | |||
Outlook attachment to network folder | Excel Discussion (Misc queries) | |||
Can't 'SaveAs' Directly to Network Folder | Excel Programming |