Trouble exporting chart to htm file - need help

J

Jacson

*Bump*
I receive a run time error 1004 within the macro below.
The message says, "Application-defined or object-defined
error".
Being a real novice, I don't know what to look for. So any
help would be appreciated.

Using Excel 2000, my worksheet periodically imports
selected data from an Oracle 9i database. On the same
worksheet the data is charted. I want the chart to be
periodically dumped to a .htm file so users opening
the .htm file see the updated chart data.

workbook is sample_db_query_to_html.xls
worksheet is AvgMin_by_Loc
chart title is Average Minutes by Location
output htm path is \\Shared\Office\Temp\AvgMinLoc.htm

Here's the macro:
Sub Auto_Open()
ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
"\\Shared\Office\Temp\AvgMinLoc.htm", _
"AvgMin_by_Loc", "", xlHtmlStatic, _
"sample_db_query_to_html.xls_16365", _
"Average Minutes by Location").Publish (True)
Application.OnTime Now + TimeValue("00:05:00"), _
"Auto_Open"
End Sub

Any ideas what might cause the error would be accepted.
Thanks.
..
 
C

Cory Lantman

I received that error before using the same type of code.
Check to make sure that the path you're writing the .htm
file to exists. If it doesn't, Excel won't create it and
it will just error out.
 
R

Roy

this works in my application using Excel XP...

With ActiveWorkbook.PublishObjects.Add
(xlSourceChart, "\\servername\foldername\chart.htm", "Chart
2" _
, "", xlHtmlChart, "gathery_31521", sheader)
.publish (True)
.AutoRepublish = False
End With
 

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