Page 1 of 1
How to add-in TM1API.dll to my VBE?
Posted: Wed Aug 22, 2012 6:17 am
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?
Re: How to add-in TM1API.dll to my VBE?
Posted: Wed Aug 22, 2012 9:39 am
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.)
Re: How to add-in TM1API.dll to my VBE?
Posted: Thu Aug 23, 2012 2:25 pm
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
Re: How to add-in TM1API.dll to my VBE?
Posted: Thu Aug 23, 2012 2:43 pm
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).
Re: How to add-in TM1API.dll to my VBE?
Posted: Wed Aug 29, 2012 5:33 am
by roei61
Thanks. the probelm solved.