By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,583 Members | 617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,583 IT Pros & Developers. It's quick & easy.

missing Excel 2000 properties and methods

P: n/a
I'm converting a vbscript program to vb.net. Witht he exception of .net
idiosyncrasies, most of it is working well with the same code. My only
problem is that some properties and methods are missing from the Chart
object. For instance, the following line worked fine in vbscript
(csPowerSpeed is the chart):

objXL.csPowerSpeed.seriescollection.newseries()

However, in VS.Net, newseries is no longer avaialable as a method for series
collection! The only options I have are Equals, GetHashCode, GetType and
ToString.

Same problem occurs with other properties and methods such as
Axes().Hastitle and ChartTitle.Characters.Text. In addition,
csPowerSpeed.HasTitle = True generates an error.

Here are my DIM statements:

Dim objXL As New Excel.Application
Dim wbOutput As Excel.Workbook = objXL.Workbooks.Add
Dim wsCSV As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'temporary worksheet(s)
Dim wsGeneric As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'generic worksheet object
Dim wsDataRed As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'data reduction worksheet object
Dim wsStdDev As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'standard deviation worksheet object
Dim csPowerSpeed As Excel.Chart =
DirectCast(objXL.Charts.Add(objXL.Worksheets(objXL .Worksheets.Count)),
Excel.Chart) 'power plot chart object
Dim csTorqueSpeed As Excel.Chart =
DirectCast(objXL.Charts.Add(objXL.Worksheets(objXL .Worksheets.Count)),
Excel.Chart) 'torque plot chart object

I have included Imports for the Office 2000 and Excel 2000 libraries in my
vb.net project. Workbook and worksheet functions all perform perfectly; only
charts have a problem. In addition, the properties and methods were all
available in my vbscript. Anyone have an idea what could be going wrong here?
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
nevermind-- solved it trough trial-and-error. Just DIMming seriescollection
and axes objects solved the problem, as shown:

Dim seriesPowerSpeed As Excel.SeriesCollection =
csPowerSpeed.SeriesCollection
Dim seriesTorqueSpeed As Excel.SeriesCollection =
csTorqueSpeed.SeriesCollection
Dim axesPowerSpeed As Excel.Axes = csPowerSpeed.Axes
Dim axesTorqueSpeed As Excel.Axes = csTorqueSpeed.Axes

The weird thing is I don't even need to use the variables for the
functionality to work as it should; just DIMming the variables seems to do
the trick. Go figure.

Hope this helps someone else!

"Randall Arnold" wrote:
I'm converting a vbscript program to vb.net. Witht he exception of .net
idiosyncrasies, most of it is working well with the same code. My only
problem is that some properties and methods are missing from the Chart
object. For instance, the following line worked fine in vbscript
(csPowerSpeed is the chart):

objXL.csPowerSpeed.seriescollection.newseries()

However, in VS.Net, newseries is no longer avaialable as a method for series
collection! The only options I have are Equals, GetHashCode, GetType and
ToString.

Same problem occurs with other properties and methods such as
Axes().Hastitle and ChartTitle.Characters.Text. In addition,
csPowerSpeed.HasTitle = True generates an error.

Here are my DIM statements:

Dim objXL As New Excel.Application
Dim wbOutput As Excel.Workbook = objXL.Workbooks.Add
Dim wsCSV As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'temporary worksheet(s)
Dim wsGeneric As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'generic worksheet object
Dim wsDataRed As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'data reduction worksheet object
Dim wsStdDev As Excel.Worksheet = DirectCast(objXL.Worksheets(1),
Excel.Worksheet) 'standard deviation worksheet object
Dim csPowerSpeed As Excel.Chart =
DirectCast(objXL.Charts.Add(objXL.Worksheets(objXL .Worksheets.Count)),
Excel.Chart) 'power plot chart object
Dim csTorqueSpeed As Excel.Chart =
DirectCast(objXL.Charts.Add(objXL.Worksheets(objXL .Worksheets.Count)),
Excel.Chart) 'torque plot chart object

I have included Imports for the Office 2000 and Excel 2000 libraries in my
vb.net project. Workbook and worksheet functions all perform perfectly; only
charts have a problem. In addition, the properties and methods were all
available in my vbscript. Anyone have an idea what could be going wrong here?

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.