Runtime Error 1004

Q

Qt NCogNeeto

Had some problems with a computer so I had to completely reinstall Windows XP and subsequently Microsoft Office 2003. I have an Excel document that had no changes between the time I reinstalled Windows XP and Excel and openedup the Excel document to test the new Office install.

In this Excel document is a button with a macro assigned to it (which, again, has not changed for months). I click on this button and get the error, 'Runtime error 1004. Application defined or object defined error.' I have posted the macro code below (code that charts a range of cells populated witha web query - simple stuff) that the VBA debugger chokes on and have notated the specific line as well. It can't be anything with the VBA code or theworksheet because I can take the same Excel document to another computer with Office 2003 installed and it works fine. I'm thinking it has to be a missing Excel/VBA component in the new install - which also baffles me because when I reinstall Office, I do a complete install - getting everything.

Here's the macro code VBA debugger doesn't like:

Sub UpdateChart()


Set Currentchart = Sheets("External Data").ChartObjects(1).Chart


picnm = ThisWorkbook.Path & Application.PathSeparator & "chart.gif"


Line that VBA Debugger doesn't like --> Currentchart.Export filename:=picnm, FilterName:="GIF"


Image1.Picture = LoadPicture(picnm)


End Sub

The text in red is the line VBA Debugger stops on. Is there some kind of web/internet VBA component I'm forgetting to reinstall?

Any assistance on this would be appreciated.

------------
 
D

DanielCo

Andy PPope wrote :
"Re: Exporting a Chart(object) EXCEL VBA. error
Ah, you probably haven't got all the graphic filters installed.

If you are comfortable looking in your registry you can use the key to
see which filters are listed.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Graphics
Filters\Export

You will need to use the Office setup to add the required graphic
filters."
 

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