Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7196219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:44:09+00:00 2026-05-28T20:44:09+00:00

I am working on one project. In that i want to check if chart

  • 0

I am working on one project. In that i want to check if chart have x or y axes or not. If not then add it. even i also want to check if x or y axes have title or not. if not then provide the title.

as i wrote one code which is checking that if x or y axes have title or not. but if not then how to add title to it?

This is a code for finding axes title

Dim oSld As Slide
Dim oShp As Shape
Dim oShapes As Shapes
Dim yaxes as Boolean
Dim xaxes as Boolean

 On Error GoTo Errorhandler:
For Each oSld In ActivePresentation.Slides

 Set oShapes = oSld.Shapes
 For Each oShp In oShapes
     If oShp.HasChart Then

                If oShp.HasChart Then

                    yaxes = oShp.Chart.Axes(xlValue, xlPrimary).HasTitle
                    xaxes = oShp.Chart.Axes(xlCategory).HasTitle

                    'check x axies have title
                    If xaxes <> True Then
                    ' Add title

                    End If 
                    'check y axies have title
                    If yaxes <> True Then
                    ' Add title

                    End If 
                End If
     End If
 Next oShp
Next

So in above code i also wants to add axes if not assign.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:44:10+00:00Added an answer on May 28, 2026 at 8:44 pm

    Something like this will

    1. leave existing axes and/or titles intact
    2. add axes/titles where they don’t exist

      Dim oSld As Slide
      Dim oShp As Shape
      Dim oShapes As Shapes
      For Each oSld In ActivePresentation.Slides
          Set oShapes = oSld.Shapes
          For Each oShp In oShapes
              If oShp.HasChart Then
                  If oShp.HasChart Then
                      With oShp.Chart
                          If Not .HasAxis(xlValue) Then .HasAxis(xlValue) = True
                          If Not .HasAxis(xlCategory) Then .HasAxis(xlCategory) = True
                          If Not .Axes(xlCategory).HasTitle Then .Axes(xlCategory).HasTitle = True
                         If Len(.Axes(xlCategory).AxisTitle.Text) = 0 Then .Axes(xlCategory).AxisTitle.Text = "I'm X"
                          If Not .Axes(xlValue).HasTitle Then .Axes(xlValue).HasTitle = True
                         If Len(.Axes(xlValue).AxisTitle.Text) = 0 Then .Axes(xlValue).AxisTitle.Text = "I'm Y"
                      End With
                  End If
              End If
          Next oShp
      Next oSld
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a fairly large project in Python that requires one of the
I'm currently working on a project with a one page design that'll slide up
I'm working on a homework assignment (a project), for which one criterion is that
I am working on project where I have the checkInternet method in one of
I'm currently working on a C++ project that needs to have as few external
I have 4 commits that I want to merge into one. Here's what comes
I am working on a Java project that I want to deliver to my
Recently I have been working on a project where, among other things, we want
I have one project that I checked out from one SVN repository location and
I`m working on a project that is examining Colorectal Cancer. And i have some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.