ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Essbase Error handling through VBA (https://www.excelbanter.com/excel-programming/427569-essbase-error-handling-through-vba.html)

RPC@Frito

Essbase Error handling through VBA
 
I'm looking for some error handling help with Essbase through VBA.
Specifically, I'm prompting the user for an ID and Password, and need to be
able to cleanly terminate the code (or some other error handling response) if
the ID and/or password they enter isn't a valid Essbase ID or password. I can
address "Cancel" quite readily, but can't find any direction on other
possible responses.

Any ideas? thanks.

Jim Thomlinson

Essbase Error handling through VBA
 
You are not so much looking for error handling as you are for invalid login
passwords. To that end the Essbase API "EssConnect" returns 0 for a
successful connection and other numbers if unsuccessful. So it is just a
matter of catching the return code and evaluating if it is 0.

dim lngConnect as Long

lngConnnect = EssConnect(sheetName, username, password, server, application,
database)

if lngConnect < 0 then
msgbox "Sorry Can't Connect"
else
'your code here...
end if
--
HTH...

Jim Thomlinson


"RPC@Frito" wrote:

I'm looking for some error handling help with Essbase through VBA.
Specifically, I'm prompting the user for an ID and Password, and need to be
able to cleanly terminate the code (or some other error handling response) if
the ID and/or password they enter isn't a valid Essbase ID or password. I can
address "Cancel" quite readily, but can't find any direction on other
possible responses.

Any ideas? thanks.


RPC@Frito

Essbase Error handling through VBA
 
That was exactly what I needed. Thank you.

"Jim Thomlinson" wrote:

You are not so much looking for error handling as you are for invalid login
passwords. To that end the Essbase API "EssConnect" returns 0 for a
successful connection and other numbers if unsuccessful. So it is just a
matter of catching the return code and evaluating if it is 0.

dim lngConnect as Long

lngConnnect = EssConnect(sheetName, username, password, server, application,
database)

if lngConnect < 0 then
msgbox "Sorry Can't Connect"
else
'your code here...
end if
--
HTH...

Jim Thomlinson


"RPC@Frito" wrote:

I'm looking for some error handling help with Essbase through VBA.
Specifically, I'm prompting the user for an ID and Password, and need to be
able to cleanly terminate the code (or some other error handling response) if
the ID and/or password they enter isn't a valid Essbase ID or password. I can
address "Cancel" quite readily, but can't find any direction on other
possible responses.

Any ideas? thanks.



All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com