On May 13, 3:31 am, unixguy <
unix...@fastmail.fm> wrote:
> ok, this is definitely the issue. I tried again, but am still having
> trouble getting the correct chart inserted in the proper place.
> Would it work better if I put each chart into a seperate
> workbook and extracted them each from there? I could
> make copies of the workbook and delete all but one
> sheet from each copy and then extract each one.
Hi,
That wouldn't work. The extracted charts would probably all point back
to first sheet of the new workbook. The important thing to keep in
mind is that the chart binaries use a simple zero based index to refer
to the worksheets that contain the chart data. The target workbook
must mirror the template workbook so that these indices are still
valid.
The best solution would be to create a new template workbook from
scratch with the sheets in the order that you want them in. However,
since you have said that the charts are complicated and you would
prefer not to have to replicate them I would suggest creating a new
template workbook with the required number of sheets. Then copy the
charts from the old template to the new one in the order that you want
them to appear (a simple copy and paste should do it). Then test the
WriteExcel program again with the new template.
John.
--