Hi Everyone,
I have a problem with getting GetSaveAsFileName() function to open Save dialogue box in a Network drive instead of always opening in my documents.
Basically, I have implemented a workaround to change path to a network drive via:
Top of my working module:
Private Declare Function SetCurrentDirectoryA Lib _
"kernel32" (ByVal lpPathName As String) As Long
Sub ChDirNet(szPath As String)
Dim lReturn As Long
lReturn = SetCurrentDirectoryA(szPath)
If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path."
End Sub
In my SaveAs() module the following code:
ChDirNet "\\test\input"
xFileName = Application.GetSaveAsFilename("\\test\input\filename.xls")
However, I STILL can not get the save as dialogue box to open in the \\test\input network path.
Can someone please advice?
Any help would be appreciated!
Thank you kindly.
I have a problem with getting GetSaveAsFileName() function to open Save dialogue box in a Network drive instead of always opening in my documents.
Basically, I have implemented a workaround to change path to a network drive via:
Top of my working module:
Private Declare Function SetCurrentDirectoryA Lib _
"kernel32" (ByVal lpPathName As String) As Long
Sub ChDirNet(szPath As String)
Dim lReturn As Long
lReturn = SetCurrentDirectoryA(szPath)
If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path."
End Sub
In my SaveAs() module the following code:
ChDirNet "\\test\input"
xFileName = Application.GetSaveAsFilename("\\test\input\filename.xls")
However, I STILL can not get the save as dialogue box to open in the \\test\input network path.
Can someone please advice?
Any help would be appreciated!
Thank you kindly.