467,219 Members | 1,073 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,219 developers. It's quick & easy.

missing Excel 2000 properties and methods

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
  • viewed: 2267
Share:
1 Reply
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.

Similar topics

1 post views Thread by Jan Agermose | last post: by
7 posts views Thread by Corepaul | last post: by
17 posts views Thread by Mansi | last post: by
7 posts views Thread by Alan Roberts | last post: by
8 posts views Thread by SteveS | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.