Solved

Refreshing MSCharts

Posted on 1998-05-03
2
301 Views
Last Modified: 2008-02-01
After I load an MSchart with data, I try to refresh the chart with new data.  I get an error when I try to refresh it with new data -- "Run-time erro 1119" It says "object uninitialized or Invalid.  Can someone please help.  ThankYou
0
Comment
Question by:imarch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1437987
See question Q.10050892
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 100 total points
ID: 1437988
imarch,

Try the following code:

Private Sub Command1_Click()
 Dim CostArray(1 To 12, 1 To 8) As Integer
 Dim RowCount As Integer
 Dim ColumnCount As Integer

 RowCount = UBound(CostArray, 1)
 ColumnCount = UBound(CostArray, 2)
 MSChart1.RowCount = RowCount
 MSChart1.ColumnCount = ColumnCount
 For Row = 1 To RowCount
  For Column = 1 To ColumnCount
   MSChart1.Row = Row
   MSChart1.Column = Column
   MSChart1.Data = CostArray(Row, Column)
  Next
 Next
 
 If cmdShort = True Then
  MSChart1.Title = "SHORT TERM COST ANALYSIS"
 ElseIf cmdLong = True Then
  MSChart1.Title = "Long TERM COST ANALYSIS"
 ElseIf cmdVacation = True Then
  MSChart1.Title = "Vacation TERM COST ANALYSIS"
 End If
 
 MSChart1.DataGrid.RowLabel(1, 1) = "jan"
 MSChart1.DataGrid.RowLabel(2, 1) = "feb"
 MSChart1.DataGrid.RowLabel(3, 1) = "mar"
 MSChart1.DataGrid.RowLabel(4, 1) = "apr"
 MSChart1.DataGrid.RowLabel(5, 1) = "may"
 MSChart1.DataGrid.RowLabel(6, 1) = "jun"
 MSChart1.DataGrid.RowLabel(7, 1) = "jul"
 MSChart1.DataGrid.RowLabel(8, 1) = "aug"
 MSChart1.DataGrid.RowLabel(9, 1) = "sept"
 MSChart1.DataGrid.RowLabel(10, 1) = "oct"
 MSChart1.DataGrid.RowLabel(11, 1) = "nov"
 MSChart1.DataGrid.RowLabel(12, 1) = "dec"
 
 MSChart1.DataGrid.ColumnLabel(1, 1) = 1996
 MSChart1.DataGrid.ColumnLabel(2, 1) = 1997
 MSChart1.DataGrid.ColumnLabel(3, 1) = 1998
 MSChart1.DataGrid.ColumnLabel(4, 1) = 1999
 MSChart1.DataGrid.ColumnLabel(5, 1) = 2000
 MSChart1.DataGrid.ColumnLabel(6, 1) = 2001
 MSChart1.DataGrid.ColumnLabel(7, 1) = 2002
 MSChart1.DataGrid.ColumnLabel(8, 1) = 2003

 MSChart1.Legend.Location.Visible = True
End Sub


Best regards
Bin Huwairib
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

617 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