Creating a function from a chart

G

Guest

Does anyone know where I can find code that will take a chart object and
create function (or a text file to be imported) for a chart.

I have a number of charts on a sheet and I want to delete the charts to make
the file smaller and then run a macro to create the charts. After all the
data has been added.

Thanks,

Ken
 
J

Jon Peltier

This is a strange objective. I'm sure it will not provide the benefits you
are seeking.

How large is your file? How much smaller is a copy of the file without the
charts? I just took a workbook with 66 charts, saved a copy without the
charts, and compared their file sizes. The workbook without charts is 90 kb,
the one with charts is 350 kb. That's under 4 kb per chart, and the charts
are rather complicated. How much space will you need to store all of the
information required to reproduce these charts, plus the VBA code? Will the
VBA procedure work reliably enough to recreate all of the charts without
issues? How much time will it take for you to develop the VBA procedures
this will require? Is it worth the effort in order to save the cost of disk
space (around $1 per 2 GB for a large external HD) or bandwidth?

- Jon
 
G

Guest

Hi Jon,

The problem is also that with the data set I have it takes a long time to
update the sheet when I re-import my data.

I inhearited the workbook so my other reason for doing this is that I want
all my charts to be the same from one sheet or workbook to another.

Ken
 
J

Jon Peltier

The problem is also that with the data set I have it takes a long time to
update the sheet when I re-import my data.

....because...? If the new data has the same layout as the old, copy it from
its original worksheets, then paste special as values onto the worksheets
used as source data by the charts.
I inhearited the workbook so my other reason for doing this is that I want
all my charts to be the same from one sheet or workbook to another.

Make a few user-defined chart types:

http://peltiertech.com/Excel/ChartsHowTo/CreateCustomTypes.html

- Jon
 

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