Reading '*.xlsm' files
16 次查看(过去 30 天)
显示 更早的评论
All of a sudden MATALAB stopped reading .xlsm files \
d = dir('*.xlsm'); %Read xlsm files in current folderPCA_Data_Set
for i = 1:size(d,1)
nom=d(i).name; %find names
nam=nom(1:7); %reduce name (for example from first to 5th character)
rename = strcat(nam,'.xlsm'); %rewrite the name
movefile(d(i).name, rename); %replacement names
end
%% Extracted sensor data
d = dir('*.xlsm');
meanX=[];names=[]; %Create empty arrays for future storage
for i = 1:size(d,1)
nom = d(i).name; %Read name of xlsm file
po=find(nom=='.'); %Search de name
nam=nom(1:po-1); %Extracted the name
opts = detectImportOptions(nom);%Read option for 'nom' matrix
T1 = readtable(nom,opts); %Read xlsm file
Tx = readtable(d(2).name,opts);
[sensors_readings] = extract_into_one_v1_UIUC7(T1);
sensor_all{i} = sensors_readings;
I get this error message...
Error using detectImportOptions (line 266)
Unable to open file 'C:\Users\Marcus Ferreira\Desktop\Ru Enose Data\Data13\Air0000.xlsm'
as a workbook. Check that the file exists, read access is
available, and the file is a valid spreadsheet file.
Error in Enose_Exctraction_code_UIUC (line 46)
opts = detectImportOptions(nom);%Read option for 'nom' matrix
1 个评论
dpb
2023-5-9
What with the renaming and all, not terribly surprised may have messed something up; nothing here anybody can do without even a single file to look at...but, my experience with such a case is that the file type doesn't match the extension given to it -- Excel won't open a file that is actually a .xlsx or .xls if it is externally renamed to something different. That would be my first guess...
回答(1 个)
Sulaymon Eshkabilov
2023-5-9
There might be another case that your intended data file(s) is (are) open and cursor is inside the file.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!