Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ThisWorkbook.SaveAs not saving correctly | Excel Programming | |||
activeworkbook.saveas - saving format changes | Excel Programming | |||
Canceling SaveAs dialog box without saving workbook | Excel Programming | |||
Disabling Saveas and saving file with a specific name only | Excel Programming | |||
SaveAs method fails when saving to FTP site. | Excel Programming |