Rank: 13387 based on 0 downloads (last 30 days) and 0 files submitted
photo

Hinrich Koetter

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Hinrich View all
Updated File Comments Rating
12 Oct 2010 xlsgraph Creates graphs from existing Excel sheet containing column data. Author: Fahad Al Mahmood

-------------------------- Excel2007 -----------------------------

Hi,
see below how I got it working with Office2007 (and Office2003).

I changed these lines:
Do not use

Excel.ActiveChart.SeriesCollection(1).Delete;

but

    try %Office2007 HK
        for zz = 1:nr
            Excel.ActiveChart.SeriesCollection(1).Delete;
        end
    end

Has to be done twice in the code.

I commented these lines:
% Excel.ActiveChart.PlotArea.Select; %HK
% Excel.Selection.Border.ColorIndex = 16;%HK
% Excel.Selection.Border.Weight = 1;%HK
% Excel.Selection.Border.LineStyle = 1;%HK
% Excel.Selection.Interior.ColorIndex = 0;%HK
% Excel.Selection.Border.ColorIndex = 2;%HK
% Excel.Selection.Border.Weight = 1;%HK

% Excel.ActiveChart.Axes(1).Crosses = 1; %HK

% Excel.Selection.Border.ColorIndex = 1; HK
% Excel.Selection.Border.Weight = 1; HK

% Excel.ActiveChart.Legend.LegendEntries(i).LegendKey.Border.ColorIndex = colors(k); HK
% Excel.ActiveChart.Legend.LegendEntries(i).LegendKey.Border.Weight = 3; HK
% Excel.ActiveChart.Legend.LegendEntries(i).LegendKey.Border.LineStyle= 1; HK

Bye, Hinrich.

08 Dec 2008 xlsgraph Creates graphs from existing Excel sheet containing column data. Author: Fahad Al Mahmood

Thank you very much! Very useful tool! For everybody who has problems like mentioned by javier seminario: You have to change some lines if you have another system setup (language):
            
Excel.ActiveChart.SeriesCollection(i).XValues = ['=' sheetname ' R2C1:R' int2str(nr+1) 'C1'];
Excel.ActiveChart.SeriesCollection(i).Values = ['=' sheetname '!R2C' int2str(i+1) ':R' int2str(nr+1) 'C' int2str(i+1)];

In this both lines as well as in the following both you have to change R (Row) and C (Column) to the abbreviations used in your language (german: Z (Zeile), S (Spalte)).

Excel.ActiveChart.SeriesCollection(noOfSeries).XValues = ['=' sheetname '!R2C' int2str(locx(j)) ':R' int2str(nr+1) 'C' int2str(locx(j))];
Excel.ActiveChart.SeriesCollection(noOfSeries).Values = ['=' sheetname '!R2C' int2str(locy(j)) ':R' int2str(nr+1) 'C' int2str(locy(j))];

In the following line you have to change word 'Sheet' (only the last one in quotation marks) to the adequate word in your language (german: Tabelle).

Sheet = get(Workbook.Sheets,'Item',['Sheet',num2str(i)]);

You can use try and catch to capture different languages.

Contact us at files@mathworks.com