472,373 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 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 2449
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....
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.