+ Reply to Thread
Results 1 to 9 of 9

Why does this code returns an automation error when changing the sheet?

  1. #1
    Registered User
    Join Date
    09-15-2019
    Location
    Spain
    MS-Off Ver
    2016
    Posts
    5

    Why does this code returns an automation error when changing the sheet?

    If Sheets(1) is replaced by Sheets(2 or higher) the macro prompts an automation error when running .Chart.Export...

    Please Login or Register  to view this content.
    I also have this bit more complicated version actually working fine in Sheet(2)...

    Please Login or Register  to view this content.
    Could anyone please point to the problem?

    Thanks in advance

    **This thread has also been posted at Stack Overflow using the same title but I am not allowed to share the link "until I post a few times".
    Last edited by JordiDash; 10-26-2019 at 02:12 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: Why does this code returns an automation error when changing the sheet?

    **This thread has also been posted out of excelforum.com but I am not allowed to share the link "until I post a few times".
    Please let us know on which other forum you posted. Thanks

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: Why does this code returns an automation error when changing the sheet?

    Administrative Note:

    Hi and welcome
    although we value privacy as much as anyone else, it could be important that members have a rough idea of your location. You might in the future post questions which are bound to your regional settings.
    So, please update your profile to something more precise then "Earth" ( country will suffice, no need to be more precise).
    Thank you for helping us to help you

  4. #4
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Why does this code returns an automation error when changing the sheet?

    Here is the link.
    https://stackoverflow.com/questions/...ging-the-sheet

    @JordiDash - "Pineapple down by the sea" is not really what Pepe meant for updating your location.

    Beth.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Why does this code returns an automation error when changing the sheet?

    Beth - "Pineapple down by the sea" is precisely what Pepe meant. It's not a helpful location, and really could do with changing. So far the OP has not edited the profile.
    Last edited by AliGW; 10-26-2019 at 05:09 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Why does this code returns an automation error when changing the sheet?

    Ahh, I assumed from Pepe's email that originally it said "Earth" and the OP changed it to "Pineapple..."

    Beth.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Why does this code returns an automation error when changing the sheet?

    No, that's his canned message.

    Thanks ever so much for the cross-post link.

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,603

    Re: Why does this code returns an automation error when changing the sheet?

    Thanks everybody, I forgot to amend the post ( old age, you know...)

  9. #9
    Registered User
    Join Date
    09-15-2019
    Location
    Spain
    MS-Off Ver
    2016
    Posts
    5

    Re: Why does this code returns an automation error when changing the sheet?

    Hey guys
    It's been a great but short time since I saw 9 new messages from my threads until I read them xD
    Location updated.
    Please, help!

+ 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. Code crashes automation error help
    By intex in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-12-2014, 06:57 PM
  2. [SOLVED] Code locks cells when inserted in sheet module but returns error in standard module
    By yoda66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 07:39 AM
  3. [SOLVED] changing cell on active sheet does not cause code to continue - No error codes either
    By SoteriaLive in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-01-2012, 11:21 AM
  4. Automation Error At Odd Spot in Code Execution
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-02-2012, 11:50 AM
  5. Automation Error with Copy Sheet Code.
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2011, 09:38 AM
  6. Automation error with userforms in my VBA code
    By Masact in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2009, 11:07 AM
  7. code Automation Error
    By Al in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2005, 06:05 PM

Tags for this Thread

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