+ Reply to Thread
Results 1 to 7 of 7

assistance on copy array sheet to a new workbook , excel crashes , get runtime error

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    I used the code below to copy active workbook to a new workbook. It works fine .

    But when I used the same as below in another workbook, my excel crashes .

    Note I recieved a batch of workbook from same supplier with same format , only contents which changes .


    Please Login or Register  to view this content.


    I used another code

    get runtime error 9, scriptt out of range


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,124

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    It looks like you have a space before page in the 3rd sheet name. Should that be there?

  3. #3
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    Now it works as below, when module is the sheet to copy but when I moved acopy to my personel.xlb, it shows script out of range when applied



    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,124

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    That's because you are referring to ThisWorkbook, which is the book that holds the macro. Try changing that to ActiveWorkbook

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,331

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    Jean...your code works fine...Look to see if the sheets actual names correspond to the names in the array.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    @Fluff & Sintek

    Ok now, active workbook and space was the issues .

    Thank you both for assistance

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,124

    Re: assistance on copy array sheet to a new workbook , excel crashes , get runtime error

    Glad we could help & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] issue with a copy macro between sheets in same workbook runtime error 9
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2017, 10:58 PM
  2. [SOLVED] assistance copy sheets getting running error in array vba
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2017, 05:29 PM
  3. [SOLVED] Copying a sheet into same workbook - runtime error 1004.
    By russwongg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2017, 11:19 AM
  4. [SOLVED] runtime error “28” and Excel crashes
    By starlev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2016, 12:17 PM
  5. Excel crashes everytime I copy sheet to a new workbook
    By este994 in forum Excel General
    Replies: 0
    Last Post: 03-06-2012, 12:42 PM
  6. Runtime Error: Overflow assistance
    By BCITgirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2010, 11:42 PM
  7. Copy sheet from another workbook - runtime error 1004
    By larne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2010, 05:45 AM

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