Excel Tutorials - Workbook VBA Events Part 2

Workbook BeforeSave Event


This event will run before a workbook saves.


Required Parameters


SaveAsUI – The SaveAsUI parameter will determine if the Save As Dialog will display. To display the Save As Dialog set the SaveAsUI value to True. If you don’t want the Save As Dialog to display set the SaveAsUI value to False.


Cancel – The cancel parameter is original set to False when the event begins. If the cancel parameter is set to value of True then the workbook will not save.


Workbook BeforeXmlExport Event


This event will run before Excel saves or exports XML data from this specific workbook.


Required Parameters


Map – The map parameter returns the map that is being saved or exported as an XMLMap object. This parameter can be used to manipulate the XML map object and its properties.


URL – The URL parameter returns location of where the XML map will be saved as a string.


Cancel – The cancel parameter is original set to False when the event begins. If the cancel parameter is set to value of True then the workbook will not save or export the XML map.


Workbook BeforeXmlImport Event


This event will run before Excel imports XML data into or refreshes XML data within this specific workbook.


Required Parameters


Map – The map parameter returns the map that is being imported or refreshed as an XMLMap object. This parameter can be used to manipulate the XML map object and its properties.


URL – The URL parameter returns address path of the XML map is saved as a string. Assigning a value to this parameter will tell Excel that is where the XML file that contains XML data is located.


IsRefresh – The isRefresh parameter will return a value of True if the XML map is being refreshed and a value of False if the XML map is being imported.


Cancel – The cancel parameter is original set to False when the event begins. If the cancel parameter is set to value of True then the workbook will not import or refresh the XML map.


Workbook Deactivate Event


This event will run every time a user selects a different workbook.


Workbook NewChart Event


This event will run every time a new chart is created in the specific workbook.


Required Parameters


Ch – The ch parameter returns the newly created chart as an chart object to allow users to manipulate the events, methods and properties.


Workbook NewSheet Event


This event will run every time a new worksheet is created within the specific workbook.


Required Parameters


Sh – The sh parameter returns the newly created worksheet as a worksheet object to allow users to manipulate the events, methods and properties.

0/Post a Comment/Comments

Previous Post Next Post