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

I'm having trouble getting this code to work. The dialog box come up and
you can navigate to the directory you want, but the file still saves to the
original file name in the original directory.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

a = MsgBox("Are sure you want to save this workbook?", vbYesNo)

If a = vbNo Then
Cancel = True
Else
SaveAsUI = True
fileSaveName = Application.GetSaveAsFilename("TCR" & Cells(20, 29) &
".xls", fileFilter:="Excel Files (*.xls),*.xls")
End If

End sub

What I want to do is force the user to save the file as TCR plus whatever is
in cell AC20, ie TCRSomeone.xls, but I'd like them to be able to save it in
the directory they choose.


 
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() in xla Bent Kjeldsen Excel Programming 6 September 24th 03 01:49 PM


All times are GMT +1. The time now is 12:01 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"