VB Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a PowerPoint template that has certain shapes, tables, etc,
that I modify based on data in an Excel workbook. My macro reads the data
from Excel, and updates information in a table, changes the color of some
shapes, and updates a chart.

I refer to the PowerPoint objects by names I have assigned them (such as
"StatusTable1"). The problem I am having is that when I update certain parts
of the PowerPoint table, PowerPoint changes the name of the table from
"StatusTable1" back to something like "Group 454", so I lose track of the
name of the object. The ID is also changed. Why does PowerPoint change the
name of the object? Is there a work around, something that references the
object that doesn't change?

Thanks,

Eric
 
I have created a PowerPoint template that has certain shapes, tables, etc,
that I modify based on data in an Excel workbook. My macro reads the data
from Excel, and updates information in a table, changes the color of some
shapes, and updates a chart.

I refer to the PowerPoint objects by names I have assigned them (such as
"StatusTable1"). The problem I am having is that when I update certain parts
of the PowerPoint table, PowerPoint changes the name of the table from
"StatusTable1" back to something like "Group 454", so I lose track of the
name of the object. The ID is also changed. Why does PowerPoint change the
name of the object? Is there a work around, something that references the
object that doesn't change?

ISTR that this is a peculiarity specific to tables. A couple guesses at
workarounds:

Ungroup the table then regroup it. I don't think the group name should change.
when you manipulate it ( though if you ungroup it, it will ).

Another approach would be to tag the shape

Call oShp.Tags.Add("MyShape","Yes")

Then when you need to find it, iterate through all the shapes on the slide and
find the one with oShp.Tags("MyShape") = "Yes"




Schroedinger wouldn't tell Heisenberg. He's not about to tell us either.
He just mumbles stuff about "Physicist, heal thyself" then wanders off to sit on
a hot stove and watch girls.
 
Thanks to both of you for answering. Yes, it changes the name of the
existing object - the table. Steve, I will try your suggestion. It is a
small table, so I may just use a bunch of individual text boxes instead.
 
Thanks to both of you for answering. Yes, it changes the name of the
existing object - the table. Steve, I will try your suggestion. It is a
small table, so I may just use a bunch of individual text boxes instead.

To save time, use a table then ungroup it. That'll give you your individual text
boxes and save you all the trouble of lining 'em up manually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top