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 Problem

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
beforesave and beforeclose Adam Harding Excel Programming 2 July 25th 05 11:11 AM
Code Problem in BeforeSave Event Kirk P. Excel Programming 3 February 23rd 05 10:08 PM
BeforeSave event j23 Excel Programming 0 April 6th 04 11:15 AM
BeforeSave Sub Phil Hageman[_3_] Excel Programming 6 January 14th 04 10:12 AM
VBA - BeforeSave - NEED HELP HRobertson Excel Programming 2 October 23rd 03 06:50 PM


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