K
kartune85
I'm having a bit of trouble with the
"Application.Dialogs(xlDialogSaveAs).Show(SvNm1)". It's been working in
my other programs but this one isn't navigating to the specified path.
I'm calling the function from within a Form, once the user clicks
'Done' it calls "Call SaveFileAs" plus rattles off a few other things.
Here is the code located in Module1:
Sub SaveFileAs()
Dim ck As Boolean
Dim SvNm1 As String
Dim fcount As String
Dim DcName As String
fcount = Range("j3")
DcName = WD1.TextBox2.Text 'WD1 = UserForm
If fcount < 33000 And fcount > 31999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\32000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 34000 And fcount > 32999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\33000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 35000 And fcount > 33999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\34000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 36000 And fcount > 34999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\35000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount > 35999 Then
MsgBox "Out of Range!"
Workbooks(1).Activate
Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True
End If
ck = Application.Dialogs(xlDialogSaveAs).Show(SvNm1)
If ck = True Then
newName = ActiveWorkbook.Name
Else
Workbooks(1).Activate
Application.DisplayAlerts = False
mycount = Range("j3") - 1
Workbooks(1).Worksheets(2).Activate
Range("j3") = mycount
Workbooks(1).Worksheets(1).Activate
Range("j3") = mycount
Call Save
ActiveWindow.Close
Application.DisplayAlerts = True
End If
End Sub
If anyone could point me in the right direction, that would be
appreciated.
Kartune85.
"Application.Dialogs(xlDialogSaveAs).Show(SvNm1)". It's been working in
my other programs but this one isn't navigating to the specified path.
I'm calling the function from within a Form, once the user clicks
'Done' it calls "Call SaveFileAs" plus rattles off a few other things.
Here is the code located in Module1:
Sub SaveFileAs()
Dim ck As Boolean
Dim SvNm1 As String
Dim fcount As String
Dim DcName As String
fcount = Range("j3")
DcName = WD1.TextBox2.Text 'WD1 = UserForm
If fcount < 33000 And fcount > 31999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\32000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 34000 And fcount > 32999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\33000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 35000 And fcount > 33999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\34000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount < 36000 And fcount > 34999 Then
SvNm1 = "\\bnefile\data\Works Docket\WD\35000\" & fcount & "-"
& WD1.TextBox2.Text
ElseIf fcount > 35999 Then
MsgBox "Out of Range!"
Workbooks(1).Activate
Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True
End If
ck = Application.Dialogs(xlDialogSaveAs).Show(SvNm1)
If ck = True Then
newName = ActiveWorkbook.Name
Else
Workbooks(1).Activate
Application.DisplayAlerts = False
mycount = Range("j3") - 1
Workbooks(1).Worksheets(2).Activate
Range("j3") = mycount
Workbooks(1).Worksheets(1).Activate
Range("j3") = mycount
Call Save
ActiveWindow.Close
Application.DisplayAlerts = True
End If
End Sub
If anyone could point me in the right direction, that would be
appreciated.
Kartune85.