Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save in VBA?
Hi,
Is there any way I can override the Save in VBA app in Excel? I meant..when user clicks the save button, I would like to have run my own business logic, and then save the excel file. If you know, please share it. Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save in VBA?
Sorry,
That's not what I wanted to ask.. Actually, I can easily do something thi via BeforeSave event... What I would like to ask is that... Once I create .NET standard window .form app.... I am going to load the excel file that is hosted by .NET In the .NET .form app, is there any way I can catch the Save event?.. I have to try..but I guess .....Excel object may provide some event property for that......Hum...Anyone? Also, if I want to create an independent .NET window form app that works with any version of Excel, I think I have to use late-biding ..right?... Once I reference the any specific dll for the Excel, then, different version of excel may not work... Thanks, "TJ" wrote: Hi, Is there any way I can override the Save in VBA app in Excel? I meant..when user clicks the save button, I would like to have run my own business logic, and then save the excel file. If you know, please share it. Thanks, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save in VBA?
To catch events for all open workbooks, you need to use Application
Level events. In a class, use code like Option Explicit Private WithEvents XLApp As Excel.Application Private Sub Class_Initialize() Set XLApp = Application End Sub Private Sub XLApp_WorkbookBeforeSave(ByVal Wb As Workbook, _ ByVal SaveAsUI As Boolean, Cancel As Boolean) Debug.Print Wb.Name End Sub The terminology will be different in NET, but the concept is the same. See http://www.cpearson.com/excel/AppEvent.aspx for a discussion of application events. This page is geared toward VB6/VBA, but it should be very easy transliterate to NET. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Mon, 27 Oct 2008 18:12:00 -0700, TJ wrote: Sorry, That's not what I wanted to ask.. Actually, I can easily do something thi via BeforeSave event... What I would like to ask is that... Once I create .NET standard window .form app.... I am going to load the excel file that is hosted by .NET In the .NET .form app, is there any way I can catch the Save event?.. I have to try..but I guess .....Excel object may provide some event property for that......Hum...Anyone? Also, if I want to create an independent .NET window form app that works with any version of Excel, I think I have to use late-biding ..right?... Once I reference the any specific dll for the Excel, then, different version of excel may not work... Thanks, "TJ" wrote: Hi, Is there any way I can override the Save in VBA app in Excel? I meant..when user clicks the save button, I would like to have run my own business logic, and then save the excel file. If you know, please share it. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
Disable save, save as, but allow save via command button | Excel Programming | |||
How to diasble save and save as menu but allow a save button | Excel Programming | |||
how to get disk icon on save button of save as dialog like 2000 | Excel Discussion (Misc queries) | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming |