Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

SaveAs Dialog comes up twice???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chemicals - 23 Feb 2007 19:39 GMT
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
Tom Ogilvy - 23 Feb 2007 19:43 GMT
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

Signature

Regards,
Tom Ogilvy

> 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
[quoted text clipped - 19 lines]
>     End If
> End Sub
chemicals - 23 Feb 2007 20:02 GMT
MUCH OBLIGED Tom!

> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
>     'Check for Save versus SaveAs
[quoted text clipped - 28 lines]
> >     End If
> > End Sub
Joel - 23 Feb 2007 20:10 GMT
I think you need to change this line from <> to =

If strDocName = "False" Then

> 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
[quoted text clipped - 19 lines]
>     End If
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.