Thread Subject:
How to change the dimensions of a Chart in Excel using Activex from MATLAB

Subject: How to change the dimensions of a Chart in Excel using Activex from MATLAB

From: Scott

Date: 26 Apr, 2012 13:48:07

Message: 1 of 1

I have the following code to creat a chart in excel but I cant figure out how to change the dimensions of the chart.

Workbooks = Excel.Workbooks;
Workbook = Workbooks.Add;
Sheets = Excel.ActiveWorkBook.Sheets;
sheet1 = get(Sheets, 'Item', 1);
Activesheet = Excel.Activesheet;
Range = 'A1:B10';
Data(:,1) = 1:10';
Data(:,2) = Data(:,1).^2;
ActivesheetRange = get(Activesheet,'Range',Range);
set(ActivesheetRange, 'Value', Data);
Chart = invoke(Workbook.Charts,'Add');
Excel.ActiveChart.ChartType = 'xlXYScatterLinesNoMarkers';
invoke(Chart, 'SetSourceData', ActivesheetRange);
Chart.Location('xlLocationAsObject', 'Sheet1');

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
activex Scott 26 Apr, 2012 09:49:14
excel Scott 26 Apr, 2012 09:49:14
chart Scott 26 Apr, 2012 09:49:14
dimensions Scott 26 Apr, 2012 09:49:14
rssFeed for this Thread

Contact us