Call a program from Save As dialog

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to call another program from the Save As ... dialog in Excel
(and possible other Office programs too), does anybody know how to do that?
Appreciate any help.
Gungmas
 
Excel has a workbook_beforesave event.

And you can use that to check to see if you're doing a SaveAs.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If SaveAsUI = True Then
Shell "C:\yourpath\yourExe.exe"
End If

End Sub

I don't know about other office programs. You may want to post in the specific
applications (word/ppt/access) for help--if you don't get it here.

Chip Pearson has a white paper at:
http://www.cpearson.com/excel/events.htm
You may want to take a look at it.

He also has a sample workbook that will show how the events fire (and in what
order) at:
http://www.cpearson.com/excel/download.htm
Look for EventSeq.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Great, thanks for your speedy reply!

Gungmas

Dave Peterson said:
Excel has a workbook_beforesave event.

And you can use that to check to see if you're doing a SaveAs.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If SaveAsUI = True Then
Shell "C:\yourpath\yourExe.exe"
End If

End Sub

I don't know about other office programs. You may want to post in the specific
applications (word/ppt/access) for help--if you don't get it here.

Chip Pearson has a white paper at:
http://www.cpearson.com/excel/events.htm
You may want to take a look at it.

He also has a sample workbook that will show how the events fire (and in what
order) at:
http://www.cpearson.com/excel/download.htm
Look for EventSeq.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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