Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Italo Rebouças  
#1 Posted : 29 November 2023 07:22:45(UTC)
Italo Rebouças


Rank: Member

Groups: Registered
Joined: 29/11/2023(UTC)
Posts: 10
Brazil
Location: Mossoró, RN

Hello guys,

I started recently creating SMath .exe files and have had some problems with files that import data from excel. Most recently, i created a script to calculate resistence of Hollow structural Sections. The script imports correctly the data from the excel spreadsheet which contains the database of sections while the .exe show the following error:

"[ERROR] [Utils.OpenWorkbook()] Não foi possível encontrar Planilha auxiliar.xlsx. É possível que ele tenha sido movido, renomeado ou excluído?"
, which translates to:

"[ERROR] [Utils.OpenWorkbook()] It wasn't possible to find "Planilha auxiliar.xlsx". Is it possible that it has been moved, renamed or excluded?"

It's weird because the spreadsheet that i created is named "Planilha Auxiliar.xlsx" with an "A", not an "a".

Someone knows what may be happening? I think that maybe i created initially the spreadsheet called "Planilha auxiliar.xlsx" and changed to "Planilha Auxiliar.xlsx" but i don't know why this would be relevant if the script refers to the latter and not to the former.

Thanks in advance.

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 29 November 2023 09:41:09(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1331 time(s) in 876 post(s)
What function/plugin are you using? And how are you referencing the file? (absolute/relative... Please post a small example to understand the context)

Windows' filesystem is case insensitive, therefore usually doesn't matter (also the error message might be processed somehow), so the a/A is unlikely to be a real issue.

Edited by user 29 November 2023 10:36:39(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Italo Rebouças  
#3 Posted : 29 November 2023 22:09:04(UTC)
Italo Rebouças


Rank: Member

Groups: Registered
Joined: 29/11/2023(UTC)
Posts: 10
Brazil
Location: Mossoró, RN

Thanks Davide,

I attached a print showing one portion of the script which references the file, the file containing the error messages and a print of the .exe file.

Question.rar (128kb) downloaded 2 time(s).
Offline Davide Carpi  
#4 Posted : 29 November 2023 23:18:31(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1331 time(s) in 876 post(s)
Thank you. It is the plugin XLSXUpdate.

Just to be sure, the excel file is in the same folder as the executable?

You might try to pass the function an absolute path concatenating the filename with the path from CurrentDirectory(""Wink.





If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 30/11/2023(UTC)
Offline Italo Rebouças  
#5 Posted : 30 November 2023 00:04:25(UTC)
Italo Rebouças


Rank: Member

Groups: Registered
Joined: 29/11/2023(UTC)
Posts: 10
Brazil
Location: Mossoró, RN

Thanks Davide, it worked.

You should consider launching a SMath course. I'd buy it and am sure a lot of others would too.
Offline Italo Rebouças  
#6 Posted : 30 November 2023 06:25:10(UTC)
Italo Rebouças


Rank: Member

Groups: Registered
Joined: 29/11/2023(UTC)
Posts: 10
Brazil
Location: Mossoró, RN

Davide, thinking about it, the problem of this solution is that if i share the .exe file with someone, this person will not be able to use it, since the script won't find the reference.
Offline Davide Carpi  
#7 Posted : 30 November 2023 07:54:35(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1331 time(s) in 876 post(s)
Originally Posted by: Italo Rebouç Go to Quoted Post
Davide, thinking about it, the problem of this solution is that if i share the .exe file with someone, this person will not be able to use it, since the script won't find the reference.


That's why you use a dynamic absolute path with Current Directory instead of typing manually a static absolute path.

In some plugin you don't need this step since it is automated in the backend (If I remember correctly XlsxImportExport should have it implemented), but is not guaranteed in all plugins, because it's not something you notice unless you test the plugin in the viewer.

Edited by user 30 November 2023 12:32:41(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Italo Rebouças  
#8 Posted : 25 April 2024 10:23:50(UTC)
Italo Rebouças


Rank: Member

Groups: Registered
Joined: 29/11/2023(UTC)
Posts: 10
Brazil
Location: Mossoró, RN

Hello,

I'm coming back to this thread because now i'm having a similar but different problem. The scripts which were working normally are not anymore. The links to the excel spreadsheets are not working and the following message is showing:

"Index invalid (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))"

Does anyone know what might be causing this?

Thanks in advance.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.