FileServer with GetOpenFilename

  • Thread starter Thread starter Philipp Oberleitner
  • Start date Start date
P

Philipp Oberleitner

Here my code :

Public fName As String
Sub Auto_Open()
ChDrive "\\Mchh227a\FS000458\"
ChDir "\\Mchh227a\FS000458\TS B\TS B 2 (MD MM pWLAN
SAM)\IntegrationProjects\# Templates\ServiceBlueprints\SLA Violation
Radar\Actis Scan"
fName = Application.GetOpenFilename
'MsgBox fName
End Sub


Is it possible to use a Fileserver instead of a drive letter ? If not how
can i integrate so he can open directories on FileServer ?

Thanks alot in advance
 
Hi Philipp,

You can use the SetCurrentDirectoryAPI to set the current directory to
a UNC path. Here's a quick procedure that will do this:

Private Declare Function GetCurrentDirectoryA Lib "kernel32" _
(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Public Sub SetUNCPath(ByVal szPathToSet As String)
SetCurrentDirectoryA szPathToSet
End Sub

Despite the name, it works on regular drive\path strings as well.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top