+ Reply to Thread
Results 1 to 3 of 3

"Method ‘Range’ of object ‘_Worksheet’ failed" error message in Excel/PowerPoint VBA

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    "Method ‘Range’ of object ‘_Worksheet’ failed" error message in Excel/PowerPoint VBA

    Greetings,

    I've written a macro that creates PowerPoint charts from data in an Excel workbook.

    It is nearly functional, except for a
    Please Login or Register  to view this content.
    failed error message.

    The macro is run in a PowerPoint instance with no slides. It creates the correct PowerPoint chart with the data from the first Excel workbook sheet, but fails at this line
    Please Login or Register  to view this content.
    when it gets to the second sheet in the Excel workbook. Specifically it says method
    Please Login or Register  to view this content.
    when I hover over the line in the VBA editor. Also,
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    still refer to the 1st worksheets data range.

    This leads me to believe that my:
    Please Login or Register  to view this content.
    References are not properly cycling through to the next sheet in the Excel workbook. This is weird because when I use a static range such as in
    Please Login or Register  to view this content.
    , the macro goes through the sheets as it should.

    I greatly appreciate any help. My full macro is below:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,289

    Re: "Method ‘Range’ of object ‘_Worksheet’ failed" error message in Excel/PowerPoint VBA

    You have no worksheet reference for Cells in the line causing the error.

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: "Method ‘Range’ of object ‘_Worksheet’ failed" error message in Excel/PowerPoint VBA

    Thanks! Worked. Can't believe I missed that.

+ 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] Runtime Error: 1004 Method 'Visible' of Object "_Worksheet' failed
    By Sorjas in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-15-2015, 02:29 AM
  2. [SOLVED] "Method 'Range' of object '_worksheet' failed" when a different sheet is active
    By CO# in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 11:48 AM
  3. XL03 Sort error: "Method 'Range' of object '_Worksheet' failed"
    By AdLoki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2011, 08:23 AM
  4. "Method 'Range' of object '_Worksheet' failed" error in Windows Script Host
    By jikenj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2010, 02:18 PM
  5. Error in Macro: "Method 'Paste' of object '_Worksheet' failed"
    By blork in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2006, 01:50 PM
  6. What is Error "Method "Paste" of object "_Worksheet" failed?
    By vat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2006, 04:10 PM
  7. "GoalSeek method of Range object failed" error message
    By Fixit_Steve in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2005, 04:06 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