Hi,
Can anyone please help me in figuring out what change needs to be done to the below code in order to show the chart (the chart I want is displayed only when I click the "Switch Row/Column" button on the toolbar, I want it to be displayed automatically without manually clicking the button - please see the attached file). Below is my code: -
Private Sub DisplayGraph()
-
Try
-
Dim xlApp As Excel.Application
-
Dim xlWorkBook As Excel.Workbook
-
Dim xlWorkSheet As Excel.Worksheet
-
Dim misValue As Object = System.Reflection.Missing.Value
-
-
xlApp = New Excel.ApplicationClass
-
xlWorkBook = xlApp.Workbooks.Add(misValue)
-
xlWorkSheet = xlWorkBook.Sheets("sheet1")
-
xlApp.Visible = True
-
-
'Adding Data..
-
xlWorkSheet.Cells(1, 1) = 2
-
xlWorkSheet.Cells(1, 2) = 1
-
xlWorkSheet.Cells(2, 1) = 3
-
xlWorkSheet.Cells(2, 2) = 2
-
xlWorkSheet.Cells(3, 1) = 2
-
xlWorkSheet.Cells(3, 2) = 5
-
xlWorkSheet.Cells(4, 1) = 4
-
xlWorkSheet.Cells(4, 2) = 7
-
xlWorkSheet.Cells(5, 1) = 8
-
xlWorkSheet.Cells(5, 2) = 2
-
xlWorkSheet.Cells(6, 1) = 5
-
xlWorkSheet.Cells(6, 2) = 3
-
-
Dim oChart As Excel._Chart
-
oChart = xlWorkBook.Charts.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value)
-
-
oChart.ChartWizard(xlWorkSheet.Range("A1", "B6"), Excel.XlChartType.xlXYScatterLines, Missing.Value, _
-
Excel.XlRowCol.xlRows, _
-
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, _
-
Missing.Value, Missing.Value)
-
Catch ex As Exception
-
MessageBox.Show(ex.Message)
-
End Try
-
-
End Sub
-
Any help is highly appreciated.
Regards,
Aads
0 1271 Sign in to post your reply or Sign up for a free account.
Similar topics |
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),
|
by: mscir |
last post by:
Date: Thu, 08 Jul 2004 17:02:27 -0700
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <10ero4l3kp2qa65@corp.supernews.com>
Reply-To: mscir@usa.com
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@supernews.com
|
by: cfriedalek |
last post by:
I'm driving Excel from python, largely successfully. Now I'm trying to
add errorbars to XY scatter plots. Keep getting a com_error. Can't
track down the problem.
I modified a simple example to duplicate the problem. Thanks to Mathieu
Fenniak http://www.stompstompstomp.com/weblog/entries/67/ for the code.
The traceback is shown below. You can see that the Excel chart series
has a method called ErrorBar. But when I try to use it with any...
|
by: Takeadoe |
last post by:
I'm doubtful that the group is unbiased, but I will ask anyhow :o). If
one intends to plot lots of data, primarily XY line and scatter plots,
and mass produce them (in many cases I will be doing 88 graphs at a
time - 1 for each of 88 counties), will Exel be the best bet, or is
Access equally capable? I might mention that in time, I will be moving
all of my data into Access databases. I'm slowing learning charting
and automation in...
|
by: Hendri Adriaens |
last post by:
Hi,
I'm trying to automate the creation of an excel file via COM. I copied my
code below. I read many articles about how to release the COM objects that I
create. The code below runs just fine and excel is closed. But there are
some commented lines:
//xlSeries.XValues = xlWs.get_Range("B2", "B4"); // makes com objects, but
which...
| |
by: grant |
last post by:
I'm trying to use a scatter chart to plot level reading for a pump
station level sensor.
The sensor takes a reading every 4 seconds, and there are 23,000
reading per chart
There appears to be a limit of 4000*4000 data points in MS Chart so I
have had a play with the Office 10 activX chart control, but cant get
that to plot the data at all. It always try to summaries the data for
some reason fathomable only to Bill Gates! Mind you, the...
|
by: Phil Stanton |
last post by:
I have a form with a button which is supposed to open an Excel file (With
lots of Macros /VBA) in it. The Excel file gets it's data from the Access
program
Here is the code
Private Sub Storage_Click()
On Error GoTo Err_Storage_Click
|
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...
|
by: DaveD170 |
last post by:
Hi everybody,
I'm newbie in c# and I'm having trouble in creating an excel chart.
I have vector of data that my program calculated.
It's in the next format:
X Y
0.1 100
0.2 90
0.3 80
etc.
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |