Consulting

Results 1 to 1 of 1

Thread: Excel VBA Macro event Workbook_BeforeSave

  1. #1

    Excel VBA Macro event Workbook_BeforeSave

    Hi All,
    I developed an Excel VBA macro. The basic functionality is to disable*save*and instead use*saveas*while trying to save excel.
    I used*Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) event.
    The macro is working perfectly, forcing users to use*save as*option even though users clicked on*save*button.
    The actual problem starts now,
    I created a word document and inserted the excel macro as an object inside the word document. When I clicked on the excel in word document it popped a message that to "Enable macros" or "disable macros"
    I clicked on "Enable macros". The macro is working fine except while clicking the*save*option, its saving inside the word document, but not forcing to use*save as.*I also found Workbook_BeforeSave event not running while clicking on*save*however when I clicked onSave as, the Workbook_BeforeSave event is running.

    Note: I am using Office 2010
    Please let me know how to resolve.
    Thanks
    Last edited by Bob Phillips; 02-14-2012 at 06:45 AM. Reason: Removed surplus HTML tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •