matlab gui to exe error(i cannot load excel file)

i can not load excel file in exe file only
in matlab gui it works properly
here is my code.
%
[fileName,pathName]=uigetfile('*.xls','Select your file'); %온도 레코더
handles.fileName=[fileName,pathName];
[~,txt,~]=xlsread(fileName,'C27:C30000');
[Ch1,~,~]=xlsread(fileName,'E27:E30000');
%

4 Commenti

uigetfile() does not promise that pathName will end in a directory separator. You should use fullfile(pathName, fileName)
... And you also reversed the order when you constructed the file name. You put the filename and then the directory.
it still doesn't work ...i don't know what's wrong
i think xlsread function doesn't work in exe
[fileName, pathName] = uigetfile('*.xls','Select your file'); %온도 레코더
if ~ischar(fileName)
error('User cancel file selection');
end
handles.fileName = fullfile(pathName, fileName);
[~,txt,~] = xlsread(handles.fileName, 'C27:C30000');
[Ch1,~,~] = xlsread(handles.fileName, 'E27:E30000');
thanks it's working now..
you are my lifesaver

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Environment and Settings in Centro assistenza e File Exchange

Tag

Richiesto:

il 5 Gen 2019

Commentato:

il 6 Gen 2019

Community Treasure Hunt

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

Start Hunting!

Translated by