Solved

Export to gif or jpg using excel

Posted on 2001-07-31
8
1,837 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now