• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

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

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
jjxia2001
Asked:
jjxia2001
1 Solution
 
KimputerCommented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now