VBA-Excel. File-SaveAs

  • Thread starter Thread starter frombrb
  • Start date Start date
F

frombrb

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
 
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
(e-mail address removed)
 
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
 
Ramesh
Application.Dialogs(xlDialogSaveAs).Show
or
Application.Dialogs(xlDialogSaveCopyAs).Show

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top