Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SaveAs not saving...

I have the following code:

Private Sub CommandButton1_Click()
If OptionButton1 = True _
Or OptionButton2 = True _
Or OptionButton3 = True Then
'ok to save
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excel Workbook (*.xls), *.xls")
Else
MsgBox "Please selecet a 'Project Status' before submitting!" &
vbLf & " FILE NOT SAVED!!"
End If
End Sub

It does everything right (i.e. opening the Save As dialog box or the
Message Box when required) up until the actual saving of the Workbook.
When I click "OK" the dialog box closes without saving, as if I had hit
"Cancel" instead. What am I missing? Thanks in advance for the help!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default SaveAs not saving...

Hi Joe,
You need to call Save or SaveAs method of the workbook object to save the
changes
Eg:
ActiveWorkBook.Save Changes:=True

Thanks
Xcelion




"JoePro82" wrote:

I have the following code:

Private Sub CommandButton1_Click()
If OptionButton1 = True _
Or OptionButton2 = True _
Or OptionButton3 = True Then
'ok to save
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excel Workbook (*.xls), *.xls")
Else
MsgBox "Please selecet a 'Project Status' before submitting!" &
vbLf & " FILE NOT SAVED!!"
End If
End Sub

It does everything right (i.e. opening the Save As dialog box or the
Message Box when required) up until the actual saving of the Workbook.
When I click "OK" the dialog box closes without saving, as if I had hit
"Cancel" instead. What am I missing? Thanks in advance for the help!!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default SaveAs not saving...

Hi Joe,

The GetSaveAsFilename method merely returns the user's selection. You need
to save the file.

So, after the fileSaveName line, insert:

ThisWorkbook.SaveAs filesavename


---
Regards,
Norman



"JoePro82" wrote in message
oups.com...
I have the following code:

Private Sub CommandButton1_Click()
If OptionButton1 = True _
Or OptionButton2 = True _
Or OptionButton3 = True Then
'ok to save
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excel Workbook (*.xls), *.xls")
Else
MsgBox "Please selecet a 'Project Status' before submitting!" &
vbLf & " FILE NOT SAVED!!"
End If
End Sub

It does everything right (i.e. opening the Save As dialog box or the
Message Box when required) up until the actual saving of the Workbook.
When I click "OK" the dialog box closes without saving, as if I had hit
"Cancel" instead. What am I missing? Thanks in advance for the help!!



Reply
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
ThisWorkbook.SaveAs not saving correctly Ron[_28_] Excel Programming 2 December 23rd 04 12:29 PM
activeworkbook.saveas - saving format changes tk3 Excel Programming 3 August 2nd 04 05:14 PM
Canceling SaveAs dialog box without saving workbook CDotWin Excel Programming 3 July 24th 04 01:09 AM
Disabling Saveas and saving file with a specific name only Hari[_3_] Excel Programming 3 June 14th 04 08:34 PM
SaveAs method fails when saving to FTP site. Steve Brennan[_2_] Excel Programming 2 September 30th 03 09:03 PM


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

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

About Us

"It's about Microsoft Excel"