Please Can any one help me in connecting to the TM1 using VBA and also how to set the path variable and load the dll's?
Thanks,
Luke
How to connect to TM1 Using VBA and add the DLL'S?
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: How to connect to TM1 Using VBA and add the DLL'S?
Err....
If you are using VBA (in Excel) rather than VB, just load the Perspectives XLA, which will pull all the DLLs in, and use N_Connect.
Or have I missed something?
If you are using VBA (in Excel) rather than VB, just load the Perspectives XLA, which will pull all the DLLs in, and use N_Connect.
Or have I missed something?
-
- Site Admin
- Posts: 6647
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: How to connect to TM1 Using VBA and add the DLL'S?
What David said.Luke Noah wrote:Please Can any one help me in connecting to the TM1 using VBA and also how to set the path variable and load the dll's?
Thanks,
Luke
You may be confusing two different methods of automation. With the classic API you need to set the Path environment variable to point to the libraries. (This is discussed in the API manual. My irritation that the installation program does not automatically update the path will be found scattered liberally around this Forum.) There is no need to load the DLLs to use the APIs in VBA.
The other method is to use macro functions, including the N_Connect one that David mentioned, details of which will be found in the Reference Guide. (A link to which is here.)
The classic API is an ugly beast of a thing and should always be your last resort, particularly in VBA where you have the whole array of both macro and worksheet functions at your disposal via the Perspectives add-in. These are all much less mind-bending and far easier to work with than the API is. They can't do everything that the API can do, but for VBA purposes they are usually more than enough.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
- paulsimon
- MVP
- Posts: 808
- Joined: Sat Sep 03, 2011 11:10 pm
- OLAP Product: TM1
- Version: PA 2.0.5
- Excel Version: 2016
- Contact:
Re: How to connect to TM1 Using VBA and add the DLL'S?
Hi
One thing that may be confusing you is that the Macro functions are still described in Excel 4 format
eg N_CONNECT( server, user, password)
When using this in VBA you need
Application.run "N_CONNECT", sServer, sUser, sPassword
Basically the name of the Macro is the first argument to the run function.
Regards
Paul Simon
One thing that may be confusing you is that the Macro functions are still described in Excel 4 format
eg N_CONNECT( server, user, password)
When using this in VBA you need
Application.run "N_CONNECT", sServer, sUser, sPassword
Basically the name of the Macro is the first argument to the run function.
Regards
Paul Simon
-
- Site Admin
- Posts: 6647
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: How to connect to TM1 Using VBA and add the DLL'S?
True. But to be fair to Iboglix (and when it comes to documentation, that can be really, really hard to do), that is pretty well explained under the "Accessing Macro Functions from VBA Modules" topic that sits near the top of the Reference Guide link that I gave above.paulsimon wrote: One thing that may be confusing you is that the Macro functions are still described in Excel 4 format
eg N_CONNECT( server, user, password)
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- Posts: 4
- Joined: Tue Feb 16, 2016 12:52 pm
- OLAP Product: IBM Cognos TM1
- Version: 10.2.2
- Excel Version: 2013
Re: How to connect to TM1 Using VBA and add the DLL'S?
Yeah Paulsimon , I was confused about that. I tried with Application.run and It was successful.
Thanks,
Luke
Thanks,
Luke