Read the last row of excel spreadsheet using actxserver
6 views (last 30 days)
Show older comments
Ilias Minas on 22 Sep 2022
Answered: Fangjun Jiang on 22 Sep 2022
I have the following issue.
I use actxserver in order to link an Excel spreadsheet with Matlab and create graphs automatically. Below is the script that i am using
%% Link to Excel spreadsheet
% Start Excel and open Workbook
excel = actxserver('Excel.Application');
wb = excel.Workbooks.Open('C:\Users\ilimin\Desktop\test2.xlsx'); % Copy in the '' the location of the spreadsheet
% Makes the created sheet visible
excel.Visible = true;
%% Speed Graph
% Creates a blank chart in another Sheet
chart1 = wb.Charts.Add;
% Set the range of the data and the source ('Name of the Sheet')
So far it works great but I would like to ask if there is any way of detecting the last row of the Excel spreadsheet without do it manually, and after this use it in the last command (char1.SetSourceData).
Thank you very much
Fangjun Jiang on 22 Sep 2022
I hope this debug message gives you a clue.
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!