Executable file not working

I have a GUI, which I created a standalone of it. My GUI works fine in Matlab environment but I know that the executable version is not doing what it was supposed to do. How can I know that where it breaks? How can I debug?

2 件のコメント

Walter Roberson
Walter Roberson 2016 年 2 月 16 日
Are there any hints about what is going wrong? What do you observe that is different than the non-.exe version?
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 16 日
I found out the exact line of code where the exe file is breaking. I am creating an active server (actxserver) for Excel Application. So I perform some operation and save the excel. Its breaking while I try to save.
The exact code is eWorkbook.SaveAs(filename);
Can you tell me whats wrong with this line of code that the exe file doesnt work?
Thank You

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2016 年 2 月 16 日

0 投票

What is the filename? It isn't in a folder where you don't have permission to write to, like c:\program files\matlab for instance? Please copy and paste the complete error message - everything that it spews to the console window.
Also see the FAQ for more things to try.

10 件のコメント

Praveen Choudhury
Praveen Choudhury 2016 年 2 月 16 日
My filename is C:\Praveen\Tools\OBD Checklist\Reports\A.xslx
My complete error message is
Error in createexcelreport_1 (line 24)
Error in createchecklist_2>save_button_Callback (line 163)
Error in gui_mainfcn (line 96)
Error in createchecklist_2 (line 45)
Error in @(hObject,eventdata)createchecklist_2('save_button_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Image Analyst
Image Analyst 2016 年 2 月 16 日
編集済み: Image Analyst 2016 年 2 月 16 日
Well a specific error message isn't there - it could be almost anything. It looks like the main routine is createexcelreport_1() and it calls createchecklist_2(), when you then click the Save button in createchecklist_2 and then the error gets generated. Is that right?
Did you look at the FAQ? Otherwise, try putting in as many messages with fprintf() or uiwait(msgbox()) as you can - like before every line in the save button callback showing you what the variable values are.
Otherwise, call tech support.
I presume it runs properly in MATLAB, right? And eWorkbook is a valid object - not null or undefined, right?
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 16 日
Ya eworkbook is valid. I inserted msgbox into my code and thats how I found out that in createexcelreport_1 my code is breaking. And to be specific in the line eWorkbook.SaveAs(filename)
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 16 日
Also it runs perfectly in MATLAB.
Image Analyst
Image Analyst 2016 年 2 月 16 日
Is Excel already open? Type control-shift-Esc before you run the program to double check. It might not be able to save it if it is already open in a prior instance of Excel.
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 16 日
No, excel is not open. I double checked it also.
Image Analyst
Image Analyst 2016 年 2 月 16 日
Are you 100% sure that the C:\Praveen\Tools\OBD Checklist\Reports folder exists on the target computer? Check beforehand. Create it if it's not there or select a different folder:
[folder, baseNameNoExt, ext] = fileparts(filename);
if ~exist(folder, 'dir')
message = sprintf('Warning: folder does not exist:\n%s\nWorkbook not saved!', folder);
uiwait(warndlg(message));
else
% Delete any prior file
recycle('on'); % Deleted files will go to recycle bin.
delete(filename);
% Save this one.
eWorkbook.SaveAs(filename);
end
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 17 日
Yes I am 100% sure that the folder exists. Because when I run in MATLAB it runs and saves my excel files in that folder. I guess something else is happening.
Image Analyst
Image Analyst 2016 年 2 月 17 日
So, just to be clear, your development computer is the same as the target computer that you deployed the compiled app to?
Praveen Choudhury
Praveen Choudhury 2016 年 2 月 17 日
Yes I am using my computer only to run the app. It is working fine in my MATLAB environment but breaks while i run the .exe

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDebugging and Analysis についてさらに検索

質問済み:

2016 年 2 月 16 日

コメント済み:

2016 年 2 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by