Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create Excel chart using C#

Hello,

Where can one find the Visual Studio Tools for Office help file? I
downloaded the Visual Tools for Microsoft Office System 2003 and
didn't find the help file. I

Thanks,

Jeff

"Sashi" wrote in message
http://groups.google.com/groups?selm...0a%40p hx.gbl...
I could not find much documentation on step 4 above.
I am trying Workbook.Charts.Add(). Is there any good
documentation or sample C# code for this?


Hi,

I copied this straight out of the Visual Studio Tools for Office help
file:


// ---------
public void CreateChart()
{
Excel.Worksheet thisWorksheet;
thisWorksheet = thisWorkbook.ActiveSheet as Excel.Worksheet;
Excel.ChartObjects charts =
(Excel.ChartObjects)this.thisWorksheet.ChartObject s(Type.Missing);

// Adds a chart at x = 100, y = 300, 500 points wide and 300 tall.
Excel.ChartObject chartObj = charts.Add(100, 300, 500, 300);
Excel.Chart chart = chartObj.Chart;

// Gets the cells that define the bounds of the data to be
charted.
Excel.Range chartRange = this.thisWorksheet.get_Range("A5","D8");
chart.SetSourceData(chartRange,Type.Missing);

chart.ChartType = Excel.XlChartType.xlXYScatter;
Excel.SeriesCollection seriesCollection=
(Excel.SeriesCollection)chart.SeriesCollection(Typ e.Missing);
Excel.Series series =
seriesCollection.Item(seriesCollection.Count);
}

//----------

Peter

--
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no
rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Create Excel chart using C#

There is no help file, MSDN is where you will find all the information!
Refer to this website for the VBA reference.
http://msdn.microsoft.com/library/de..._ancoffice.asp


"Jeff Boeker" wrote in message
om...
Hello,

Where can one find the Visual Studio Tools for Office help file? I
downloaded the Visual Tools for Microsoft Office System 2003 and
didn't find the help file. I

Thanks,

Jeff

"Sashi" wrote in message

http://groups.google.com/groups?selm...0a%40p hx.gbl...
I could not find much documentation on step 4 above.
I am trying Workbook.Charts.Add(). Is there any good
documentation or sample C# code for this?


Hi,

I copied this straight out of the Visual Studio Tools for Office help
file:


// ---------
public void CreateChart()
{
Excel.Worksheet thisWorksheet;
thisWorksheet = thisWorkbook.ActiveSheet as Excel.Worksheet;
Excel.ChartObjects charts =
(Excel.ChartObjects)this.thisWorksheet.ChartObject s(Type.Missing);

// Adds a chart at x = 100, y = 300, 500 points wide and 300 tall.
Excel.ChartObject chartObj = charts.Add(100, 300, 500, 300);
Excel.Chart chart = chartObj.Chart;

// Gets the cells that define the bounds of the data to be
charted.
Excel.Range chartRange = this.thisWorksheet.get_Range("A5","D8");
chart.SetSourceData(chartRange,Type.Missing);

chart.ChartType = Excel.XlChartType.xlXYScatter;
Excel.SeriesCollection seriesCollection=
(Excel.SeriesCollection)chart.SeriesCollection(Typ e.Missing);
Excel.Series series =
seriesCollection.Item(seriesCollection.Count);
}

//----------

Peter

--
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no
rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I create a transparent chart in Excel? Env Eng Student Charts and Charting in Excel 2 March 1st 10 01:26 PM
Why create a chart in Excel? laney New Users to Excel 5 April 13th 07 06:06 PM
How can I create a 4D chart in excel? Anneli Touart Charts and Charting in Excel 0 February 23rd 06 10:39 AM
How to create a z chart in excel ? Bilal Charts and Charting in Excel 4 January 30th 06 10:56 AM
how do I create a stacked bar chart in excel PatK Charts and Charting in Excel 2 July 5th 05 02:33 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"