Write in an opened excel file using MATLAB

I would like to search for a specific number like (5444 ) in column B and insert a number like (300) next to it in column C using matlab script while the file is opend , thanks
date B C
05/20/2022 5444 ?
05/22/2022 5445 ?
FileName = 'C:\\\\Desktop\test.xlsx';

댓글 수: 6

Just use a spreadsheet. You don't really want to use MATLAB, and you are still thinking how to solve your problem as if it was a spreadsheet.
Max
Max 2022년 5월 22일
I want to use an matlab script to do this
Do we understand correctly that you want to use a matlab script to inject formulas into the excel spreadsheet and tell excel to execute the formulas?
Max
Max 2022년 5월 31일
Yes but no exactly , my script generat a value and i would like to inject it into excel but in specific location
Have you considered using xlswrite1() that I linked to? It opens a connection to excel and leaves it open for efficiency, and can write by range specification.
Max
Max 2022년 6월 1일
I have but I could not get to work while the file is open

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 5월 23일

0 개 추천

In particular the reading logic
Select(Range(Excel,sprintf('%s',range)));
DataRange = get(Excel,'Selection');
and then
rawData = DataRange.Value;
to fetch the data from Excel.

카테고리

제품

태그

질문:

Max
2022년 5월 21일

댓글:

Max
2022년 6월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by