+ Reply to Thread
Results 1 to 4 of 4

Problems placing a title on a chart

  1. #1
    Forum Contributor
    Join Date
    02-01-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    222

    Problems placing a title on a chart

    I am using the following code to place a tite on a chart:-
    Please Login or Register  to view this content.
    When I run this code I get the error "This chart does not have a title". I do not get this message every time I run the code, although I have not yet been able to characterise the situations where it works.
    I am new to chart coding so I am using Macros to help me. I must have gone wrong somewhere however and need some help to show me where.
    John

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,530

    Re: Problems placing a title on a chart

    The code so far assumes that when inserting a chart, it always contains a title. As you can see, this is not always the case, although I do not know the reason.
    I propose a little code improvement.
    Please Login or Register  to view this content.
    Artik

  3. #3
    Forum Contributor
    Join Date
    02-01-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    222

    Re: Problems placing a title on a chart

    Artik many thanks for your thoughts. The app was open when I first copied your code in and to my great delight it worked. I then closed everything down and then reopened the app, clicked the button for this procedure and then got the object variable not set message this time for the line If not ActiveChart. HasTitle Then . The full code contains some lines to clear off any charts for previous runs. I think I will move that to the close procedure. What I cannot understand is why there should be a difference depending on when you start.
    John

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,530

    Re: Problems placing a title on a chart

    Try this code which does exactly the same as yours, just without selecting any objects.
    If the situation does not improve, try repairing your Office installation.
    Please Login or Register  to view this content.
    Artik

+ 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. Changing the Chart Title without Changing the existing Chart Title Format
    By trizzo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2016, 02:05 PM
  2. [SOLVED] Placing Chart where I want it.
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2014, 10:37 PM
  3. placing chart Title and Date above chart
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-11-2014, 10:02 AM
  4. [SOLVED] placing chart name and date above chart
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-10-2014, 08:12 PM
  5. placing a title at the bottom of the screen
    By mfairhurst1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2013, 06:00 PM
  6. retieving cd title and placing it into excel
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2006, 09:50 PM
  7. Pasting Objects into Chart title and Axis title
    By Sam in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-06-2005, 04:05 PM

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