SaveAs Dialog comes up twice???

C

chemicals

I am trying to force the user to always save the workbook as a newly named
file into a specific folder. My problem is that the Save As dialog comes up
twice???? Here's my code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Check for Save versus SaveAs
If SaveAsUI Then
SaveAsFile
CreateShortCut
End If
End Sub

Sub SaveAsFile()
Dim strDocName As String
Const FilePath As String = "H:\ProdDev\Client\"

ChDrive FilePath
ChDir FilePath
strDocName = Application.GetSaveAsFilename
If strDocName <> "False" Then
ActiveWorkbook.SaveAs Filename:=strDocName
End If
End Sub
 
T

Tom Ogilvy

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Check for Save versus SaveAs
If SaveAsUI Then
SaveAsFile
CreateShortCut
Cancel = True
End If
End Sub
 
C

chemicals

MUCH OBLIGED Tom!

Tom Ogilvy said:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'Check for Save versus SaveAs
If SaveAsUI Then
SaveAsFile
CreateShortCut
Cancel = True
End If
End Sub
 

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

Top