Consulting

Results 1 to 3 of 3

Thread: Disable Macros

  1. #1
    VBAX Tutor Philcjr's Avatar
    Joined
    Jul 2005
    Location
    Bedminster, NJ
    Posts
    208
    Location

    Disable Macros

    All,

    I am currently working on some code in which "file (1)" will open another excel file "file (2)" and copy its contents from multiple worksheets and past the data onto one sheet in "file (1)".

    I need to know how to "disable" the macros when "File(2)" opens from the execution of the code in "File(1)"

    Thanks,
    Phil

  2. #2
    VBAX Mentor Justinlabenne's Avatar
    Joined
    Jul 2004
    Location
    Clyde, Ohio
    Posts
    408
    Location
    Add

    Application.EnableEvents = False

    before your line of code that opens the Workbook.
    At the procedure's end, reset it to True.
    Justin Labenne

  3. #3
    VBAX Tutor Philcjr's Avatar
    Joined
    Jul 2005
    Location
    Bedminster, NJ
    Posts
    208
    Location
    Justine,

    Thanks... works perfect.

Posting Permissions

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