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.
TM1 Connection Status
-
- Regular Participant
- Posts: 269
- Joined: Tue Apr 21, 2009 3:43 am
- OLAP Product: Cognos TM1, Planning
- Version: 9.1 SP3 9.4 MR1 FP1 9.5
- Excel Version: 2003
-
- Posts: 51
- Joined: Thu Jul 24, 2008 6:14 am
Re: TM1 Connection Status
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
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

- Martin Ryan
- Site Admin
- Posts: 2003
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: TM1 Connection Status
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
Another point, my method won't work with integrated login, Lukas' will.
Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
-
- Posts: 3
- Joined: Sun Oct 23, 2011 5:21 am
- OLAP Product: TM1 Perspectives
- Version: 9.1.0.1
- Excel Version: 207
Re: TM1 Connection Status
Thanks guys for the posts. They helped a TONNN! There is no way I could have figured this out without your submissions.
-
- Posts: 3
- Joined: Sun Oct 23, 2011 5:21 am
- OLAP Product: TM1 Perspectives
- Version: 9.1.0.1
- Excel Version: 207
Re: TM1 Connection Status
Thanks for the help guys. The posts were very useful!