Running TM1 process from VBA

Post Reply
Jayme1
Posts: 14
Joined: Thu Mar 27, 2014 5:30 pm
OLAP Product: turbo intergrator
Version: cognos express
Excel Version: Excel 2009

Running TM1 process from VBA

Post by Jayme1 »

Hello everyone

is there a simple bit of code to run a TI process from Excel? is this all the code i need?

ExcecuteProcess(sServer, sProcess)


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

Re: Running TM1 process from VBA

Post by lotsaram »

No. It isn't that simple by half as you have to declare a whole lot of API stuff but you can just copy / paste this so it isn't that hard either. Pretty sure TM1 Tools available from here has that in it.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Running TM1 process from VBA

Post by declanr »

Does it have to be from VBA or would an action button suffice?
Declan Rodger
User avatar
Alan Kirk
Site Admin
Posts: 6610
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: Running TM1 process from VBA

Post by Alan Kirk »

Jayme1 wrote:
is there a simple bit of code to run a TI process from Excel? is this all the code i need?

ExcecuteProcess(sServer, sProcess)
Lotsaram is correct; TM1 Tools (which can be downloaded from here) has a wrapper around the API functions so that you can do a simple one line call, including passing parameters. The method is explained in the documentation.

But Declan is also correct; the need to do this has largely (though not entirely) been superseded by action buttons.
"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.
Jayme1
Posts: 14
Joined: Thu Mar 27, 2014 5:30 pm
OLAP Product: turbo intergrator
Version: cognos express
Excel Version: Excel 2009

Re: Running TM1 process from VBA

Post by Jayme1 »

Thanks a lot everyone for your help, I have now copied across the VBA needed to run a process. this all works fine on my machine, but on other it comes up with errors as they need a 64 bit machine to run the process. Bit of a shame as it was all working fine for me, any ideas?

Just on one final note, as i like to make things simple but i assume the answer is no:

Can you call an action button from vba? such as actionbutton.click? I have code that needs to run before and after some VBA. This would be neater than running the VBA AVI code (that only works on 64bit).

Thanks again

Jaimie
Wim Gielis
MVP
Posts: 3126
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Running TM1 process from VBA

Post by Wim Gielis »

Jayme1 wrote:Can you call an action button from vba? such as actionbutton.click? I have code that needs to run before and after some VBA. This would be neater than running the VBA AVI code (that only works on 64bit).
Not directly, AFAIK. But you can use VBA to read the TI process name attached to the action button. Then run that one with TM1Runti.exe or TM1 Tools coding.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Alan Kirk
Site Admin
Posts: 6610
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: Running TM1 process from VBA

Post by Alan Kirk »

Jayme1 wrote: This would be neater than running the VBA AVI code (that only works on 64bit).
It does who in the what now?

I assure you that it doesn't only work on 64 bit. Traditionally the TM1 Excel client has been 32 bit only, intended to run under 32 bit Excel. It was only with version 10.2.2 that a 64 bit add-in was provided for 64 bit Excel. I don't have (or want, for the foreseeable future) 64 bit office so I haven't tested either VBA code or even TM1 Tools on that (you can't install 32 and 64 bit office side by side, though at some point I'll create a VM for it), but I can assure you that the VB API does work in a 32 bit environment and has done for literally decades now. If you're getting errors, something else is going on, but without knowing full details of the error it would be impossible to say what.
"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.
Post Reply