Error at .exe file that import for excel

Error at .exe file that import for excel - Сообщения

#1 Опубликовано: 29.11.2023 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 Опубликовано: 29.11.2023 03:41:09
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: 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 Опубликовано: 29.11.2023 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 КиБ) скачан 27 раз(а).
#4 Опубликовано: 29.11.2023 17:18:31
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: 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 29.11.2023 19:08:00
#5 Опубликовано: 29.11.2023 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 Опубликовано: 30.11.2023 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 Опубликовано: 30.11.2023 01:54:35
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: 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 Опубликовано: 25.04.2024 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.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений