Winopen does not work on executable

Hello everyone, I am trying to make an app and it works fine, but when I compile it to a standalone app winopen() will not work. Any ideas?
I have included the winopen.m during packeging and also used full Path, but still it does not work.

2 件のコメント

Abderrahim. B
Abderrahim. B 2022 年 8 月 8 日
編集済み: Abderrahim. B 2022 年 8 月 8 日
Hi!
what is the format of the file you are trying to open ? and on which operating system you are testing the App?
Thanks
Nikos Gartaganis
Nikos Gartaganis 2022 年 8 月 8 日
I am trying to open an excel.xlsx file and I am using win10.
I have found a workaround by making a function that opens cmd and the open the excel file.
function [] = myOpenFile(filename)
!cmd &
inputemu('key_normal',filename)
inputemu('key_normal','\ENTER');
inputemu('key_normal','exit')
inputemu('key_normal','\ENTER');
inputemu('key_normal','exit')
inputemu('key_normal','\ENTER');
end
You need also the inputemu.m function. It works fine for me, even when the app is already compiled.

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

回答 (1 件)

dpb
dpb 2022 年 8 月 8 日

0 投票

I've packaged it (winopen) in another app and it works fine. Looking at the above code snippet, I'd hypothesize your problem is that you're not using the fully-qualified filename to open and so it isn't finding the file -- but winopen unfortunately doesn't include any return parameter to report on its success in that regards; you could(*) do an exist on the filename first to ensure it does exist and is found first.
(*) Probably "should" instead of "could" is more appropriate

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

質問済み:

2022 年 8 月 8 日

回答済み:

dpb
2022 年 8 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by