Error at .exe file that import for excel

Error at .exe file that import for excel - 消息

#1 已发布: 2023/11/29 01:22:45
Ítalo Oliveira Rebouças

Ítalo Oliveira Rebouças

0个赞,共10个帖子。

组: User

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.
#2 已发布: 2023/11/29 03:41:09
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 已发布: 2023/11/29 16:09:04
Ítalo Oliveira Rebouças

Ítalo Oliveira Rebouças

0个赞,共10个帖子。

组: User

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 (127.92 KiB)已下载 430 次。
#4 已发布: 2023/11/29 17:18:31
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

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("").





If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1位用户喜欢此帖子
Oscar Campo 2023/11/29 19:08:00
#5 已发布: 2023/11/29 18:04:25
Ítalo Oliveira Rebouças

Ítalo Oliveira Rebouças

0个赞,共10个帖子。

组: User

Thanks Davide, it worked.

You should consider launching a SMath course. I'd buy it and am sure a lot of others would too.
#6 已发布: 2023/11/30 00:25:10
Ítalo Oliveira Rebouças

Ítalo Oliveira Rebouças

0个赞,共10个帖子。

组: User

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.
#7 已发布: 2023/11/30 01:54:35
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

Wrote

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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#8 已发布: 2024/4/25 04:23:50
Ítalo Oliveira Rebouças

Ítalo Oliveira Rebouças

0个赞,共10个帖子。

组: User

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.
  • 有新帖
  • 无新帖