N_Disconnect Crashes when Rules are open

Post Reply
Darkhorse
Posts: 141
Joined: Wed Mar 09, 2011 1:25 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2003 2007 2010 2013

N_Disconnect Crashes when Rules are open

Post by Darkhorse »

Hi all

is there a way to check to see if the Rules editor is open and to close the rules editor first before using the command N_Disconnect in a macro?

currently the N_Disconnect works perfectly if its just cubes open and will close them down and log off the servers, however if i have a rule editor open at the same time it causes my Tm1 to hang and i need to crash out.

thanks all
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: N_Disconnect Crashes when Rules are open

Post by rmackenzie »

Darkhorse wrote:is there a way to check to see if the Rules editor is open and to close the rules editor first before using the command N_Disconnect in a macro?
You can use the FindWindow function in the Windows API from Excel VBA. Using this function will allow you to identify if a Rules Editor window is open, then you can alert the user to close it before running the disconnect logic. This is, at least, an intermediate exercise, but you can get the result you want. There are examples:

Good ol' Daily Dose of Excel (from 2004!)
Good ol' Chip Pearson
Good ol' Mr Excel
Robin Mackenzie
Post Reply