Page 1 of 1

TM1 Connection Status

Posted: Mon Aug 10, 2009 7:16 am
by appleglaze28
I'd like to know if there'a VBA TM1 Function, that allows you to determine whether you are connecte to TM1 or not? Other than the green light icon that indicates it in Excel.

I just realize in case I would hide all sheet except the main menu with the login, and once you logged on from there is the only way you can move on to the succeeding sheets. I was wondering what if the user is already logged on via Perspective and decide to view the template, the user will not be able to move on to the other sheets unless the user logs out of the perspect and log in from the Menu. I was a VBA code to recognize that when a user opens the Excel template and is logged in from Perspective, it will automatically skip the menu sheet and directed to the other sheets.

Re: TM1 Connection Status

Posted: Mon Aug 10, 2009 2:41 pm
by Lukas Meyer
If you are at or above 9.1 you can use the Excelsheet function TM1USER("theservername") - which will return the users name if he is logged on to that specific server. (You can use the function via Run("TM1USER","theservername"))

There are more sophisticated methods too, but they would require me to look in my VBA snippets library which is currently not available to me since it resides on a citrix profile which takes about half an hour to load - if you need something better, simply ask :)

Re: TM1 Connection Status

Posted: Mon Aug 10, 2009 7:26 pm
by Martin Ryan
Lukas' method will suit your needs perfectly well. In the days before this function was available I would try to connect using the N_connect macro with a non-existent user. If you were already connected it would return the string "Already connected". If you weren't connected it gave another message like "Username invalid".

Another point, my method won't work with integrated login, Lukas' will.

Martin

Re: TM1 Connection Status

Posted: Mon Oct 24, 2011 1:37 am
by cac692
Thanks guys for the posts. They helped a TONNN! There is no way I could have figured this out without your submissions.

Re: TM1 Connection Status

Posted: Mon Oct 24, 2011 4:02 pm
by cac692
Thanks for the help guys. The posts were very useful!