+ Reply to Thread
Results 1 to 3 of 3

ChartObject.Chart run time error

  1. #1
    Registered User
    Join Date
    01-12-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    9

    ChartObject.Chart run time error

    Hello!
    I am officially new to the forum, but I have been browsing as a guest for a few weeks as I learned and developed my first VBA macros!

    Hear me out on this one, the history of how I got to this point may be important.
    • I created a script in MS Project that outputs data to a specific MS Excel macro enabled template. I then created a script in that MS Excel template which process and charts the data. Although a bit cumbersome, everything worked great!
    • Now I am trying to put all functionality into the MS Project script, including the data processing and the charting in Excel.
    • Everything is working very well up to this point, but I am stuck at the chart object and chart. I am mystified as the code run is identical to what I had in the Excel based script, which mirrors a a tutorial about charting which I followed (successfully).

    Yes, I did reference the Microsoft Excel 16.0 Object Library in the MS Project VBA.


    Please Login or Register  to view this content.
    Any ideas? Like I said, I'm fairly new to this.
    Let me know if you see anything obvious, or need some additional information or attachments.
    Thanks in advance!

    clams

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: ChartObject.Chart run time error

    Does it make any difference if you fully qualify the objects?
    I can not test as I do not have MS Project

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    01-12-2021
    Location
    Canada
    MS-Off Ver
    365
    Posts
    9

    Re: ChartObject.Chart run time error

    Hi Andy,
    Thank you for taking the time to review this code. You were correct!

    As soon as I implemented, I found that there was an error thrown on the next few lines, where I start to work with the Chart series.
    Below is a description of the error and how I was able to resolve it. Perhaps someone else will be able to use this information in the future.


    Previous code
    Please Login or Register  to view this content.
    Fixed code

    Please Login or Register  to view this content.
    Voila! I am certainly learning a lot. I guess the references were mixing up the compiler since MS Project has a chart object as well? I am not sure.
    I will mark this thread as solved from here on out.

+ 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] VBA and Charts: best way to test for Chart vs. ChartObject
    By tcarnahan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-22-2015, 08:28 AM
  2. Chart Min and Max Scale change Run-time Error
    By webharvest in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2015, 04:26 AM
  3. [SOLVED] Loop through worksheets and format chart 1: run time error
    By surePac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2014, 01:53 PM
  4. Cannot Publish Excel Pivot Chart - Run Time Error
    By crisb184 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2013, 07:04 AM
  5. Pivot Chart, Run-time Error
    By Jkirkwood in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2011, 01:29 PM
  6. Run-time Error '1004' in a chart
    By ravichander in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 03-17-2010, 12:44 PM
  7. how to set a variable to a Chart? not ChartObject
    By Rich in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2005, 03: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