Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default SaveAs Dialog comes up twice???

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default SaveAs Dialog comes up twice???

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

--
Regards,
Tom Ogilvy



"chemicals" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default SaveAs Dialog comes up twice???

MUCH OBLIGED Tom!

"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy



"chemicals" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default SaveAs Dialog comes up twice???

I think you need to change this line from < to =

If strDocName = "False" Then

"chemicals" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs Dialog Box Noemi Excel Programming 1 November 8th 06 09:15 AM
SaveAs dialog Gary''s Student Excel Discussion (Misc queries) 2 February 23rd 06 03:11 PM
prevent saveAs dialog keithb Excel Programming 1 September 9th 05 06:37 PM
SaveAs Dialog box Daniel Bonallack Excel Programming 2 April 1st 05 09:25 AM
Saveas Dialog Box Tom Ogilvy Excel Programming 0 September 15th 04 04:57 PM


All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"