TM1ServerLogDirectory

Post Reply
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

TM1ServerLogDirectory

Post by AmbPin »

Hello,
I am looking for a way to get the data or log files directory for a specified server in VBA code. Does anyone know if the above APi functionis the right thing to use and if so have any pointers on how to call it.
Many thanks.
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: TM1ServerLogDirectory

Post by TrevorGoss »

Hello,
I am looking for a way to get the data or log files directory for a specified server in VBA code. Does anyone know if the above APi functionis the right thing to use and if so have any pointers on how to call it.
What exactly do you mean by "to get the data or log files directory for a specified server in VBA code"? Do you mean to return the values in an Array? or by procedure?

My VB is weak but I found this code on stackoverflow, no TM1 API was used in this code:

Code: Select all

Sub LoopThroughFiles()
    Dim MyObj As Object, MySource As Object, file As Variant
   file = Dir("z:\testfolder\")
   While (file <> "")
      If InStr(file, "test") > 0 Then
         MsgBox "found " & file
         Exit Sub
      End If
     file = Dir
  Wend
End Sub
You can edit this as you wish.
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: TM1ServerLogDirectory

Post by AmbPin »

Sorry,
Looking fo a way to determine the URL path to the log or data files folder for a specified server.
A VBA equivilant of the TI function GetProcessErrorFileDirectory()

I am trying to build a VBA UI that can be connected to more than one TM1 service at the same time and need to know the folder paths mentioned above for each.
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: TM1ServerLogDirectory

Post by TrevorGoss »

Ah ok,
Looking for a way to determine the URL path to the log or data files folder for a specified server.
A VBA equivalent of the TI function GetProcessErrorFileDirectory()
You could still pass the server name as an argument and presuppose the rest of the path string?

You could also open up the .cfg file and check the parameter for each server?

But I am unaware of a VBA equivalent for the TI function GetProcessErrorFileDirectory()

Trevor
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: TM1ServerLogDirectory

Post by AmbPin »

Thanks Trevor
I am trying to cater for situaltions where the TM1 services are on different hosts and physical servers. Also the possibility that the folder structures on these physical servers may be different.
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: TM1ServerLogDirectory

Post by TrevorGoss »

Hello again,

how about calling a TI which calls the TI function GetProcessErrorFileDirectory() and prints the return value out to a flat file, then pick up that flat file and tada....there is your path.
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: TM1ServerLogDirectory

Post by AmbPin »

Hmm, I have kind of done that.
I have a TI that sucks the contents of the tm1s.cfg file into a cube so I can get at all of the values that way.
Thanks again Trevor
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: TM1ServerLogDirectory

Post by TrevorGoss »

Hmm, I have kind of done that.
I have a TI that sucks the contents of the tm1s.cfg file into a cube so I can get at all of the values that way.
Thanks again Trevor
Indeed, these are all ways around your problem rather than facing it directly, good luck!

Trevor.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TM1ServerLogDirectory

Post by tomok »

The best place for this information, if needed by a TI process, or VBA, really is a cube. I normally put a cube in all my models that stores all this type of data, like data directory, logging directory, port#, etc., to make it easy to get to instead of having to open the .cfg file. It almost never changes so all you have to do is set it up and populate it one time.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: TM1ServerLogDirectory

Post by AmbPin »

tomok wrote: I normally put a cube in all my models that stores all this type of data
Good idea, thanks.
Post Reply