473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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
1 2539
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jan Agermose | last post by:
Im writing information into an existing excel document using a connection string like: strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Filename + ";Extended Properties=\"Excel...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
17
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
1
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of...
7
by: Alan Roberts | last post by:
Can someone please explain the following for me... I am trying to link to a .NET DLL from Excel. Excel needs to pass a reference to itself to the DLL and then the DLL needs to perform some work...
8
by: SteveS | last post by:
I'm attempting to close EXCEL from within my VB.NET application. Using the excel object library to write data to my spreadsheet is working fine but when I try to quit application object it does not...
8
by: KeithChang | last post by:
Hi, I'm building a web application in VB.NET 1.1 where users will upload Excel files at this webpage and the web application will transfer the data from the uploaded Excel file into MS SQL 2000....
3
by: NEWSGROUPS | last post by:
I am in the midst of trying to convert about 25 Access 2000 to Access 2003. The new environment consists of Office/Access 2003 and Outlook 2003. When converting the back ends I have no problems....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.