LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Exporting Chart to GIF File

I am new to developing in VBA for Excel. I'd appreciate any tips on
how to fix this bug, as I believe I am on the right track but something
I can't quite see is incorrect. Thanks in advance.

I have a workbook with 7 sheets. Let's say on worksheet 5 there are 5
charts. On Worksheet 6 I have 5 option buttons, and for each button
that I select I want to display a particular chart. I have been able
to successfully loop through my chart objects and verify that I have 5,
yet when I try to export each of them I get the following error:

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

Below is my code sample of just trying to export one chart. The last
line of the code is where I get an error. Any help will be greatly
appreciated.

Private Sub OptionButton1_Click()
Dim strGifFileName As String
Dim CurrentChart As Chart
Dim index As Integer
index = 1
Set CurrentChart = Worksheets(6).ChartObjects(index).Chart
strGifFileName = "C:\My Documents\" & "MyChart" & index & ".gif"
CurrentChart.Export fileName:=strGifFileName, FilterName:="GIF"
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
exporting chart paunie Excel Discussion (Misc queries) 0 June 2nd 06 04:37 PM
I get COMException while exporting chart on IIS 6.0. asp newbie Charts and Charting in Excel 1 May 16th 06 08:27 AM
Exporting CSV file to unicode .txt file - " around strings Paul Excel Discussion (Misc queries) 1 June 14th 05 12:27 AM
Exporting chart to GIF file Dick Scratcher Excel Programming 5 November 1st 04 07:54 AM
Trouble exporting chart to htm file - need help Jacson Excel Programming 3 January 10th 04 07:22 AM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"