R
Ray Batig
Greetings,
The following code is part of an Excel macro which pops up the familiar file
open data sheet. Apparently Visio VB doesn't use this method. This allows
the user to drill down to the right folder which contains the file, and then
lets VB capture the path and file. How would you do this in Visio VB?
Thanks in advance for your help!
Ray
' Store the Excel file path since the GetOpenFilename will reset the
current path
Dim CurrentDir As Variant
CurrentDir = CurDir()
' Go look and point - Note you start in the Excel Files home
directory -
Dim fNameAndPath As Variant
If fNameAndPath <> False Then Reset
fNameAndPath = ""
fNameAndPath = Application.GetOpenFilename(Filefilter:="Excel Files
(*.xls), *.xls", _
Title:="Highlight File To Be Opened")
If fNameAndPath = False Then
MsgBox (" No File Selected! ")
Else
MsgBox "Selected file is:" & fNameAndPath
End If
Reset:
' Reset the CurrentDirectory to the Excel File home
The following code is part of an Excel macro which pops up the familiar file
open data sheet. Apparently Visio VB doesn't use this method. This allows
the user to drill down to the right folder which contains the file, and then
lets VB capture the path and file. How would you do this in Visio VB?
Thanks in advance for your help!
Ray
' Store the Excel file path since the GetOpenFilename will reset the
current path
Dim CurrentDir As Variant
CurrentDir = CurDir()
' Go look and point - Note you start in the Excel Files home
directory -
Dim fNameAndPath As Variant
If fNameAndPath <> False Then Reset
fNameAndPath = ""
fNameAndPath = Application.GetOpenFilename(Filefilter:="Excel Files
(*.xls), *.xls", _
Title:="Highlight File To Be Opened")
If fNameAndPath = False Then
MsgBox (" No File Selected! ")
Else
MsgBox "Selected file is:" & fNameAndPath
End If
Reset:
' Reset the CurrentDirectory to the Excel File home