+ Reply to Thread
Results 1 to 5 of 5

VBA stops after copying worksheet

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Tenn
    MS-Off Ver
    Excel 1997-2010
    Posts
    3

    VBA stops after copying worksheet

    I have been working on vba code to update a worksheet, now the code stops running when it copies a worksheet from one workbook to another. But this only happens when I try it at work. Both workbooks are .xls, since not all users have 2007 or greater. The VBA code works fine on my personal laptop.

    If I run the VBA directly from the VBA editor I'm prompted to enable macros and then it works. If the code runs as progrmmed it stops after the first .copy After:= event.

    This code used to work until about 2 weeks ago. I have no idea what the network admin has disabled to prompt for macro in every workbook, but it's stopping the code from completing.

    Is there a way to stop the code to prompt to enable macros in the second workbook?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA stops after copying worksheet

    Hi,

    Perhaps they've moved the Excel file from a 'Trusted' location to a non trusted location. Or reset the Security level from Low to Medium or High.

    Check the Application option settings.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Tenn
    MS-Off Ver
    Excel 1997-2010
    Posts
    3

    Re: VBA stops after copying worksheet

    Macro securities are grayed out and cannot be changed from Disable all Macros with notification.

    I'm using Application.EnableEvents = False to stop the macros in the second workbook from taking over and not returning the the first workbook. Like I said it was working both at home and at work up until about 2 weeks ago.

    When I enable the content in the first worbook at home they are enable when the second workbook opens. This is no longer happening at work content must be enabled for every workbook

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA stops after copying worksheet

    Please clarify which versions of Excel you have at home and work and which Application Macro settings are set in each location.
    Which version is not working, Home or at Work?

    Whichever location is greyed out, was the Excel App installed with the "install "with VBA components" parameter set. I understand that the default security settings can be set by your network Admin. Have you asked them what settings they used when installing?

    Is the work Excel App in an Microsoft Enterprise environment?

  5. #5
    Registered User
    Join Date
    08-21-2012
    Location
    Tenn
    MS-Off Ver
    Excel 1997-2010
    Posts
    3

    Re: VBA stops after copying worksheet

    I'm using 2002 thru 2010 at home, all versions are set to prompt to allow macros (olderr versions are sett at medium, newer version disabled with notìfication. Work is 2007 and macros are set disable all with notification and cannot be changed.

    All version work at home.

    I'm convinced that admin has changed some security setting

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1