Solved

Export to gif or jpg using excel

Posted on 2001-07-31
8
1,838 Views
Last Modified: 2010-08-23
I know there is a way to export charts as pictures in excel
I wish to have a couple of lines in VBA
that does that.

thanks

0
Comment
Question by:oreghe
  • 5
  • 2
8 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
ID: 6338579
Worksheets("Sheet1").ChartObjects(1) _
.Chart.Export _
    FileName:="current_sales.gif", FilterName:="GIF"
0
 
LVL 1

Author Comment

by:oreghe
ID: 6420167
I have been away.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6420231
No problem!, you are welcome anytime.
Thanks for the points/grade
Cheers
0
 

Expert Comment

by:jsbxpge
ID: 33489883
When I try this solution, I get a:

Run-time error '1004':
Application-defined or object-defined error

Any ideas on a solution?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 33500929
well, that was a solution in Office97'Age i think.
Sure you are using at least a 2003, aren't you?

PD: anyway, just a guess, how many chart have you in worksheet?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 33501009
by the way, your sheet is named "sheet1"?
try replacing sheet1 for just 1
0
 

Expert Comment

by:jsbxpge
ID: 33503096
I am using Excel 2003.  I have just one chart within a sheet. I tried renaming and am getting the same error.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 33503737
i did try with excel 2007 and it continues working!!
maybe, and just maybe, the error not belongs to that line of code... just a guess (without furter info i can speculate only)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now