Solved

Is it possible to call some of subroutines I created through Excel "Save/Save As" Function

Posted on 2014-01-03
1
233 Views
Last Modified: 2014-01-03
In Excel, when users click "Save" or "Save As" from Toolbar, I like to run some of subroutines I created.  How to do it?  Thanks!
0
Comment
Question by:jjxia2001
1 Comment
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39755393
Only from the Excel file you created, where you inserted this code:

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

    MsgBox "test"
'(add more of your own code here)

End Sub

Open in new window


It won't work if they create a new file by themselves.
Also, it will run no matter if they save the file or not. The code runs, THEN they get the save/save as file dialog where they still can press cancel.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now