LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
bmm bmm is offline
external usenet poster
 
Posts: 10
Default Workbook_BeforeSave()

Hi,
How can I trap the file save as /save event and get the filename entered in
the dialogbox?
I tried to get the file name in "Workbook_BeforeSave() " event, but it
displays the dialog twice FileSave As dialog twice.
How can i avoid that dialog appearing twice

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Application.EnableEvents = False
filesavename = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excle Files Files (*.xls), *.xls")
If filesavename < False Then
filesavename = filesavename
End If
Application.EnableEvents = True
Cancel = True
MsgBox filesavename
End Sub




 
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
HELP!!!! Calling a sub from Workbook_BeforeSave RocketMan[_2_] Excel Discussion (Misc queries) 4 May 31st 07 11:47 PM
Workbook_Beforesave getting breached Hari[_3_] Excel Programming 2 June 11th 04 10:57 PM
ThisWorkbook.Save not working under Workbook_BeforeSave, Help! Michel[_3_] Excel Programming 4 May 30th 04 06:49 PM
Workbook_BeforeSave Bill Oertell Excel Programming 5 December 21st 03 07:33 PM
Workbook_BeforeSave() in xla Bent Kjeldsen Excel Programming 6 September 24th 03 01:49 PM


All times are GMT +1. The time now is 04:14 AM.

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

About Us

"It's about Microsoft Excel"