Import excel data in gui files

I created a gui. When I writing this gui, I specified the path and then got the exe file. In this gui I use a number of Excel files as input. How can I set the path of the gui than the user can import excel files from anywhere in the system (The user may choose a file other than the path that written in the gui).

5 commentaires

dpb
dpb le 30 Juin 2019
Whatever interface you've provided the user to specify the input files must return the information including location besides just the file name itself; then your code must use that information to build and open the file using the fully-qualified name.
uigetfile() has optional pathname return variable, for example.
You'll find fullfile() and fileparts() of help in performing such shenanigans, undoubtedly.
Fayez Ferdospanah
Fayez Ferdospanah le 30 Juin 2019
Yes, I used uigetfile and fullfile to call the file. But after creating the exe, the program only accepts files from the user defined in the path of the program. While the user wants to enter paths that are not defined in the program. Because the user does not know what path I have defined in my m.file.
dpb
dpb le 30 Juin 2019
You'll have to show code; descriptions won't cut it.
If you pass a fully-qualified file name to any of the ML functions, they will open that particular file presuming the user has proper permissions, etc., etc., ...
When you build an executable, however, some functions aren't available; you'll have to ensure whatever you use is within the allowable subset for automagic code generation with the function you need or write additional code to do so directly.
I've never built a standalone executable, so can't comment from firsthand knowledge but I can't but think there's a way to accomplish the objective.
Fayez Ferdospanah
Fayez Ferdospanah le 30 Juin 2019
Thank you for your description. I built the gui and share it to other users,then I want to be usable for everyone and there was no problem.Tell me if you have any comments to make it easy for users.
dpb
dpb le 30 Juin 2019
I don't know what that means and we can't comment on what we can't see...we don't know what you've actually done other than by a verbal description.
If it doesn't do what you want, only way anybody can possibly help would be to see what you did do, specifically.

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Version

R2018a

Commenté :

dpb
le 30 Juin 2019

Community Treasure Hunt

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

Start Hunting!

Translated by