kengooch
Member
- Local time
- Today, 06:20
- Joined
- Feb 29, 2012
- Messages
- 137
So I often build a file name and then open the Application.Dialogue(xldialoguesaveas).show option to allow the user to make any changes to the file name that they need to make, however, I can't get the code to open the specified directory.
I found a snipit of code that is supposed to work for network drive locations but noted in the middle of the code down where the saveas dialogue shows, but it didn't seem to work either. And I did include the Private Declare Function SetCurrentDirectoryA Lib "kernel32" (ByVal lpPathName As String) As Long at the beginning of the module.
Appreciate any insight or help you can give.
Thanks,
Ken
I found a snipit of code that is supposed to work for network drive locations but noted in the middle of the code down where the saveas dialogue shows, but it didn't seem to work either. And I did include the Private Declare Function SetCurrentDirectoryA Lib "kernel32" (ByVal lpPathName As String) As Long at the beginning of the module.
Appreciate any insight or help you can give.
XML:
Sub mCheckMaster()
MsgBox "CheckMaster"
If vFileNmChk Like "*Master*" Then
If StrPtr(vDate) = 0 Then
MsgBox "The Macro Has Been Canceled"
GoTo EndMacro
End If
vMonth = Abs(Right(vDate, 2))
Sheets("Cycle").Range("b2").Value = vMonth
vType = InputBox("Enter S - for Surgical Pathology" & vbCrLf & " C - for Cytology", "Get Report Type")
If StrPtr(vType) = 0 Then GoTo EndMacro
If vType = "S" Or vType = "s" Then
vService = "Surgical"
ElseIf vType = "C" Or vType = "c" Then
vService = "Cytology"
End If
Sheets("Cycle").Range("B3").Value = vService
vFileNm = vDate & " " & vService & " Slide Review Report.xlsm"
MsgBox vFileNm
ChDrive "L:\"
ChDir vPathPath
'- - - attempt from code found in google search
' SetCurrentDirectoryA "\\R04mwvnas21\p&lms\KDG-MPA\Vista Capture Reports\Slide Review\QA Final Reports\"
'- - - - -
Application.Dialogs(xlDialogSaveAs).Show vFileNm
Else
End If
EndMacro:
End Sub
Thanks,
Ken