Using Chart Objects - I solved the problem

Skippy

Board Regular
Joined
Mar 3, 2002
Messages
194
I am trying to call an Excel chart from VB. This is some of the code:
Code:
Public xlApp As Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
Public xlRows As Integer
    
 
Private Sub Form_Load()

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(App.Path & "Book1.xls", , True)
Set xlSheet = xlBook.Worksheets("Charts")

XLChart xlSheet

End Sub

************************************
Sub XLChart(xlSheet As Excel.Worksheet)

    Set CurrentChart = xlSheet.ChartObjects(j).Chart

End Sub

The problem is with the "Set CurrentChart". I get an error message that the Method ChartObjects failed. Any ideas what I'm doing wrong?
This message was edited by Skippy on 2002-05-03 10:41
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,614
Messages
6,120,520
Members
448,968
Latest member
Ajax40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top