Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to use a UNC path with ChDir?
I want to replace: ChDir "G:\Shared\Access\Project Area\Project 1" with ChDir "\\[Server Name]\]Share]\Project Area\Project 1" This does now seem to work for me...should it? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Paul Smith" wrote in message
... Is it possible to use a UNC path with ChDir? I want to replace: ChDir "G:\Shared\Access\Project Area\Project 1" with ChDir "\\[Server Name]\]Share]\Project Area\Project 1" This does now seem to work for me...should it? Hi Paul, No, ChDir doesn't work with UNC paths. Here's a Windows API-based solution. It will work with either UNC or drive letters and it will modify the drive and path in one call: Private Declare Function SetCurrentDirectoryA Lib "kernel32" _ (ByVal lpPathName As String) As Long Public Sub SetUNCPath(ByVal szPathToSet As String) SetCurrentDirectoryA szPathToSet End Sub -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paths for macros | Excel Discussion (Misc queries) | |||
Paths | New Users to Excel | |||
I hate paths! | Excel Discussion (Misc queries) | |||
Help with filenames and paths. | Excel Discussion (Misc queries) | |||
file paths | Excel Discussion (Misc queries) |