+ Reply to Thread
Results 1 to 5 of 5

Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Winnipeg, Manitoba
    MS-Off Ver
    Excel 2007
    Posts
    15

    Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

    Hi,

    I had the following code which was working when I was under Windows XP. After converting to Windows 2007, I tried running the same macro to no avail. Run-time error 1004 would pop up. The debugger would highlight the Copy Before action. Any advice is greatly appreciated!

    Please Login or Register  to view this content.
    Thank you!

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

    Is this macro using more than one workbook? It doesn't seem to be. So why are you setting and activating this workbook?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

    Maybe try this:

    Please Login or Register  to view this content.
    abousetta

  4. #4
    Registered User
    Join Date
    01-22-2013
    Location
    Winnipeg, Manitoba
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

    Hi abousetta,

    Thank you for the quick reply, I will try this tomorrow when I am back at work. The code is basically trying to copy from the main workbook to generate multiple workbooks (one per region based on a region column identifier). I am not well-versed with VB and I'm sure there's a much cleaner way to get the result (your suggestion definitely looks neater). At the time when I was in Windows XP, the original code did work, but for some reason after converting to Windows 7, it went wonky.

    Much appreciated! I will follow-up tomorrow.

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Winnipeg, Manitoba
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Conversion from Windows XP to Windows 2007 has killed my macro - Run-time Error 1004

    Good morning,

    Inputting the above code gets me a new error - Run-time error 9 (Subscript out of range). Debugging highlights the following:

    Please Login or Register  to view this content.

+ 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