How to add-in TM1API.dll to my VBE?

Post Reply
User avatar
roei61
Posts: 41
Joined: Wed Aug 22, 2012 5:44 am
OLAP Product: PAX
Version: 2.0.7
Excel Version: 2016
Location: Israel

How to add-in TM1API.dll to my VBE?

Post by roei61 »

Hi,

I'm a bit new with the use of VBA and TM1 together.
I defined the bin's library in the enviorment variable as written in the guide, but "TM1APIINITIALIZE" command still not reconized in the VBE .

Can someone guide me what should I do?
Alan Kirk
Site Admin
Posts: 6667
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 add-in TM1API.dll to my VBE?

Post by Alan Kirk »

roei61 wrote: I'm a bit new with the use of VBA and TM1 together.
I defined the bin's library in the enviorment variable as written in the guide, but "TM1APIINITIALIZE" command still not reconized in the VBE .

Can someone guide me what should I do?
Rule 1 would be: Don't use the TM1 API.
Rule 2 (for experts only) would be: Don't use the TM1 API yet.

What exactly is it that you're trying to do? In he vast major cases there is no need at all to use the API; you can accomplish what you want using the Excel Macro and Worksheet functions that are built into the add-in.

If I had to make an educated guess, though, and working from the assumption that you did correctly add the path to the libraries to your PATH environment variable (since it's just too much of an effort for IBM's delicate little installer to do that for you), then most likely you haven't imported the tm1api.bas file (which contains all of the library declarations) into your project. (A copy of it should be in the installation folder.)
"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.
User avatar
roei61
Posts: 41
Joined: Wed Aug 22, 2012 5:44 am
OLAP Product: PAX
Version: 2.0.7
Excel Version: 2016
Location: Israel

Re: How to add-in TM1API.dll to my VBE?

Post by roei61 »

Thanks for your fast comment, I'll try to make myself more clear.
I have a dll file that was written several years ago which enters formulas into an Excel file which I'm working with.
I have a commandButton which Running a process.
Today the connection to the TM1 is done by the command:
"R = TM1Obj.Connect (sAdminHost, sServer, sUser, sPass)".
According to my understanding, the Connect command is in dll file and was created by the function "TM1SystemServerConnect."
Because in the old DLL not written code for Integreted Login I need to do it myself.
Therefore, I want to override the Dll file and to change the command myself, but that requires Access to the TM1API.dll or you can offer me another solution.

Thanks
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: How to add-in TM1API.dll to my VBE?

Post by lotsaram »

Why have macro code via TM1 API handle integrated login? If a user is in the file then surely they can select a server via the connect dialog or double-click on a server icon in server explorer. They should at least be trusted to do this much, and also at least be trusted to know that they need to be logged on to TM1 before they can retrieve or send any TM1 data. Then all your code needs to do is check that the user is already logged on and if not to prompt the user to log on. This can then be done by using the TM1 N_Connect macro. Seems a simpler and better alternative (at least to me).
User avatar
roei61
Posts: 41
Joined: Wed Aug 22, 2012 5:44 am
OLAP Product: PAX
Version: 2.0.7
Excel Version: 2016
Location: Israel

Re: How to add-in TM1API.dll to my VBE?

Post by roei61 »

Thanks. the probelm solved.
Post Reply