Modifying chart-Data and formatting

G

Greg

Noob here so I'll try not to test your patience.
I've been handed some existing word doc's to modify. I'm adding some VBA
programming to speed up data entry of a Test Data Record for one of our
products.
The doc has one embedded chart, which up to this point, the technician has
had to open to gain access to the underlying data (excel spreadsheet). In the
end, I'd like this doc to be a form, saved as a template. When the technician
opens the template, he selects from a pull down menu (field), which upon
exit, the chart is modified, preparing for when the technician later enters
data to the table.
Using VBA, I have been able to modify existing data in the underlying table.
What I can't seem to do is modify the chart formatting. I've got about a
thousand questions but I'll throw a few out to start the ball rolling. If I'm
way off track in my approach, please let me know. I don't want to waste time,
yours or mine.
1)Is it possible to record macros within a chart so I can see what VBA
programming result? So far, my attempts have resulted in empty macros. I'm
either doing something terribly wrong or it's not possible.
2)I am using Office 2007, which allows access to chart data with ChartData.
I've seen some older forum posts which mention checking off on
Tools>references>"Microsoft Graph 12.0 Object Library". Is this in any way
necessary for what I'm trying to do?
3)Any recommendations for a good book, specific to using VBA within word?
I'm all over reading, if it will get me where I want to go.
Thanks in advance for any help.
Greg
 
D

Doug Robbins - Word MVP

I am not sure why you would be needing to format the chart each time and
therefore be needing to automate the process. If you apply the required
formatting in the template, then if the data in the Excel spreadsheet has
changed, and the chart is linked to that data, all that you need to do is
update the chart.

Someone else may suggest some books, but I do not have any.

See the article "Getting To Grips With VBA Basics In 15 Minutes†at:
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm

and other items on that website and make use of the Visual Basic Help
facility.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Greg

Doug,
Thanks for the reply.
It's entirely possible I don't understand what is necessary to make this
work. Just to clarify though...
The chart is embedded. It has no link to an existing excel file, although
word does conjure up a version of excel when editing the chart data.
I'm not a whiz with excel either so I should explain what happens. After the
user selects from the pull down menu, I want the VBA programming to change
all the chart x-axis data, clear all y-axis data and change the chart ranges.
While it's possible there will be duplicates, for the sake of discussion,
let's assume each pull down menu selection generates a chart with a different
number of elements to be entered by the technician. I had thought it
necessary, when setting up the chart, to set the series size (number of
elements) to be exact. I suppose there might be a way to make the size the
absolute maximum, with the chart utilizing only those cells where data
exists. I'll have to try that.
I don't think I want to have the chart linked to an excel file as I would
prefer the data remain within the word doc.
Any ideas about Tools>References or recording macros within a chart? I'm
still stumped over that.
Let's work through my misconceptions and maybe I can see this thing through.
In the meantime, I'll check the link you provided.
-Greg
 

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

Top