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: 103
Default BeforeSave Event Question

Hi All,

I am trying to create a beforeSave event so that when the user presses save,
an inputbox comes up and the user specifies part of the filename and then
the code automatically adds additional information to the filename. I have
two problems:-

1) My code causes excel to crash
2) The inputbox comes up twice for some reason

Any ideas:-

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As

Boolean)

Dim FilePath As String

Dim varInput As String



FilePath = "S:\SmartMarket\SMV Project Administration\Sign-Offs\Construct

Phase\"




On Error GoTo addError

varInput = InputBox("......\Sign-Offs\Construct Phase\SMV - Sign-Off

for XXXXX.xls", _

"Sign-off Sheet Description")



ActiveWorkbook.SaveAs Filename:=FilePath & varInput & ".xls"




addError:



MsgBox "No value submitted - File Not Saved"





End Sub

Ta

Andi


 
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
Save method and BeforeSave event [email protected] Excel Programming 1 July 15th 05 04:58 AM
Code Problem in BeforeSave Event Kirk P. Excel Programming 3 February 23rd 05 10:08 PM
BeforeSave event Carl Bowman Excel Discussion (Misc queries) 4 February 6th 05 12:28 PM
BeforeSave event j23 Excel Programming 0 April 6th 04 11:15 AM
BeforeSave workbook event Cindy Excel Programming 15 February 10th 04 04:28 PM


All times are GMT +1. The time now is 02:47 PM.

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"