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: 1
Default Embedding Existing Excel chart into VB6 form

This is a code for vb6 programmers
---------------------------------
Dim xl, wbk

Private Sub Command1_Click()
Set ThisChart = wbk.sheets(1).ChartObjects(1).Chart
fName = CurDir & "\LiveChart.GIF"
ThisChart.Export FileName:=fName, FilterName:="gif"
Picture1.Picture = LoadPicture(fName)
End Sub

Private Sub Form_Load()
Set xl = CreateObject("Excel.application")
Set wbk = xl.workbooks.open(CurDir & "\LiveChart.xlsx")
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
xl.displayalerts = False
wbk.save
wbk.Close
Set xl = Nothing
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
Embedding a pie chart from excel Dig Charts and Charting in Excel 1 December 9th 07 05:26 AM
Embedding an annotation or a comment to a chart in Excel 2007 Refresher Charts and Charting in Excel 5 August 13th 07 08:01 PM
Embedding spreadsheet in a user form GeorgeJ Excel Discussion (Misc queries) 3 July 24th 07 07:20 PM
Can I scan an existing paper form into excel accounting Excel Discussion (Misc queries) 3 January 25th 07 06:13 PM
Embedding excel charts in my C# windows form Matt Kosorok Charts and Charting in Excel 0 May 11th 05 05:02 PM


All times are GMT +1. The time now is 11:22 AM.

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"