Issue with MATLAB .exe seeing data in excel as stagnant data when I need it to be able to read with each run of the .exe
1 view (last 30 days)
Show older comments
I have a program that uses XLSread and XLSwrite.
The program takes in some excel data from an excel file, we do some math, then we output to the excel file and open it up for the user to see the output.
This program works perfect in the IDE, but when I make an .EXE and try the program that way, whatever the last data I had in the excel run in the IDE, is ALWAYS the output for the .exe now. Even when I change the data in the excel file and rerun.
How would I go about making this dynamic? Or have the program read in the new data from the excel file with each subsequent run?
example:
******************************************************************************
% read in some data
[num,txt,raw] = xlsread('excelFile','REPORT');
% do some math
x= 5 * num (1)
%export it back to excel file
xlswrite('excelFile',matrix,'sheet1')
%open the file up for the user
winopen('excelFile')
******************************************************************************
any and all help is greatly aprecaited!
,Billy
0 Comments
Answers (1)
Walter Roberson
on 28 Jun 2023
read about ctfroot which is the directory that the code will be executing in, and the location that your named files will have been copied to.
The executable will NOT be running in the user's home directory. You will need to figure out the user directory by looking at windows environment variables. Caution: some of the folders named in the environment variables do not have drive letter, which is a different environment variable
See Also
Categories
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!