473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automating an excel chart using vb.net

I am trying to automate a Vb.net chart using the excel COM object. The
problem occurs when trying to run the code in different systems. It is
working fine under one of my computers but once i move it to another
one it fails giving me the error:

Additional information: Unable to set the HasMajorGridlin es property of
the Axis class
Here is a excerpt of the code being run.
0001 Public Sub displayGraph()
0002
0003 Dim xChart As Excel.Chart
0004 Dim xChartRange As Excel.Range
0005 Dim cCell As Excel.Range
0006 Dim cAxis As Excel.Axis
0007 Dim cArea As Excel.ChartArea
0008 Dim fFormat As Excel.FillForma t
0009 Dim cShape As Excel.Shape
0010 Dim sLocation() As String
0011 Dim sRow As String
0012
0013 'loop through all of the graphs
0014 sLocation = Split(graphLoca tion, ";")
0015
0016 For Each sRow In sLocation
0017
0018 'create chart
0019 xChart = wbWorkBooks.Cha rts.Add
0020 xChart.ChartWiz ard(wsCurrent.R ange(label_colu mn & sRow,

0021 label_column & sRow), , , Excel.XlRowCol. xlRows, , , False)
0022 xChart.ChartTyp e = Excel.XlChartTy pe.xlBarCluster ed
0023
0024 'Format the x-axis of the graph
0025 cAxis =
xChart.Axes(Exc el.XlCategoryTy pe.xlCategorySc ale,
0026 Excel.XlAxisGro up.xlPrimary)
0027 cAxis.HasMajorG ridlines = False
0028 cAxis.MaximumSc aleIsAuto = False
0029 cAxis.MajorUnit = 50
0030 cAxis.MaximumSc ale = 200
0031 cAxis.MinimumSc ale = 0
0032 cAxis.TickLabel s.Font.Size = 8
0033 cAxis.TickLabel s.AutoScaleFont = False
0034 cAxis.TickLabel s.NumberFormat = ""

The problem occurs on line 0027. Since this is working under a
different computer is anyone aware of additional software packages or
updates that need to be installed to make these properties accessible.
It seams that all properties of cAxis are unavailable.

Nov 21 '05 #1
0 2109

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35520
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
8
3848
by: deko | last post by:
When using automation (and especially with early binding) I've heard it is best to use explicit references to everything. For example: Dim xlChart as Excel.Chart rather than Dim objChart as Object
14
5774
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the SQL DATABASE, probably by the click of a button. Is this possible? & what is the BEST APPROACH for doing this? & also if any links are there do tell those to me too coz I have no idea how to go about doing it.
22
15328
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody reproduce the behavior described below? For this example, I am using Excel 2002 and VS .NET 2002 and VB 6. MSFT KB article 304661 gives a trivial example of early and late binding to Excel from VB .NET. Note that there is a variable naming...
1
7626
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a graph/chart within the report, once again from VB.NET. I have chosen to use Excel.Chart.8. So, to embed I do this from VB.NET: Dim theNewShape As InlineShape = m_Document.InlineShapes.AddOLEObject (ClassType:="Excel.Chart", _
1
2560
by: Randall Arnold | last post by:
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...
0
2714
by: pmclinn | last post by:
The code below takes the data from the S column and grabs all the data and graphs it. The problem is this example grabs 500 cells worth of data and some of these cells = nothing. How do I rescope a range to prevent the data that is = nothing not to display.... Dim app As New Excel.Application ' app.Visible = True Dim Doc As Excel.Workbook = app.Workbooks.Open("C:\Filename.csv") Dim Sheet As Excel.Worksheet = Doc.Sheets(1)
3
3244
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
9
3234
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly large my goal is to keep the devlopement in VB6 but am open to any ideas or suggestions. What i want to do is: 1. Keep my app in VB6 and find a workaround for the crappy looking charts. the charts now look very blocky and the grid lines and...
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7978
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8126
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6796
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.