ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA-Excel. File-SaveAs (https://www.excelbanter.com/excel-programming/323406-vba-excel-file-saveas.html)

[email protected]

VBA-Excel. File-SaveAs
 
Hi All,

Iam calling Excel page in ASP using VB Script. After the Excel page is
loaded I want the user to SaveAs in different path.
How can I do it.

any help would be glad asap.

rgds

Ramesh


Nick Hodge

VBA-Excel. File-SaveAs
 
Ramesh

Not sure how your interoperability is working but Excel has a
WorkBook_BeforeSave() event that can detect if the user presses SaveAs as
opposed to Save. You can then stop the save and advise.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = False Then
MsgBox "You must use save as NOT save", vbExclamation + vbOKOnly
Cancel = True
End If
End Sub

Alternatively, your Excel file could be saved as a template (*.xlt). This
will always only allow a SaveAs

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


wrote in message
oups.com...
Hi All,

Iam calling Excel page in ASP using VB Script. After the Excel page is
loaded I want the user to SaveAs in different path.
How can I do it.

any help would be glad asap.

rgds

Ramesh




[email protected]

VBA-Excel. File-SaveAs
 
Hi Nick,
thanks for the info, but my question is..
I want to show the user the Dialog box of SAVEAS when the excel is
loaded.

rgds

Ramesh


NickHK

VBA-Excel. File-SaveAs
 
Ramesh
Application.Dialogs(xlDialogSaveAs).Show
or
Application.Dialogs(xlDialogSaveCopyAs).Show

NickHK

wrote in message
oups.com...
Hi Nick,
thanks for the info, but my question is..
I want to show the user the Dialog box of SAVEAS when the excel is
loaded.

rgds

Ramesh





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com