Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Error - Can not open catalog as creator when running Imp user

Status
Not open for further replies.

slaforce

Programmer
Jul 29, 2002
77
US
I'm trying to run the following macro and getting the following error:

Error - 440 Impromptu: You cannot open catalog as Creator when running User Version of Impromptu.

I am running the administrator version of Impromptu.

'--------------------------------------------------------------'
' Copy User classes from a namespace to catalog User Profiles. '
'--------------------------------------------------------------'
OPTION EXPLICIT

Declare Sub User_classes(UsrClass as object, UsrProfile as object)

Sub Main ()

DIM ObjAuthApp as object
DIM ObjAuthDoc as object
DIM ObjUserClass as object
DIM ObjImpApp as object
DIM ObjCatalog as object
DIM ObjUserProfile as object
DIM ObjImpCat as object

On Error Goto Errhdlr1

'Open Namespace
Set ObjAuthApp = CreateObject("Authenticator2.Application")
Set ObjAuthDoc = ObjAuthApp.Documents.OpenWithBasicSignon ("default", "administrator","","Root User Class")

'Open catalog
Set ObjImpApp = CreateObject("CognosImpromptu.Application")
ObjImpApp.OpenCatalog "C:\dev.CAT", "Creator"
Set ObjImpCat = objImpApp.ActiveCatalog

Set ObjUserClass = ObjAuthDoc.rootuserclass
Set ObjUserProfile = ObjImpCat.ActiveUserClass

Call User_classes(ObjUserClass, ObjUserProfile)

MsgBox "User Profiles have been successfully created"

ObjImpApp.Quit
ObjAuthApp.quit

Set ObjImpApp = Nothing
Set ObjUserClass = Nothing
Set ObjAuthDoc = Nothing
Set ObjAuthApp = Nothing

exit sub

Errhdlr1:
Msgbox "Error - " & Err & ": " & Error$

End Sub

'--------------------------------------------------'
' User_classes function: '
' Navigates the Userclass hierarchy of Namespace '
' and create User Profiles in the catalog '
'--------------------------------------------------'

Sub User_classes(UsrClass as object, UsrProfile as object)

Dim ObjUsrClass as object
Dim ObjUsrProfile as object
Dim ObjMasterClass as object
Dim ObjMasterProfile as object
Dim UserClassCount as Integer

Set ObjUsrClass = UsrClass
Set ObjUsrProfile = UsrProfile
Set ObjMasterClass = UsrClass
Set ObjMasterProfile = UsrProfile
UserClassCount = ObjUsrClass.userclasses.count

If ObjUsrClass.userclasses.count <> 0 then
For UserClassCount = ObjUsrClass.userclasses.count to 1 step -1

Set ObjUsrClass = ObjMasterClass.userclasses.Item(UserClassCount)
Set ObjUsrProfile = ObjMasterProfile.userclasses.add (ObjUsrClass.name)
Set objUsrprofile=Nothing
Next UserClassCount
End If

Set ObjUsrClass = Nothing
Set ObjMasterClass = Nothing
End Sub
 
Hi slaforce,

I saw this on my demo PC. But in this case, Impromptu administrator version and user version are installed on the same PC and the macro open the user version by default. I don't know if is possible to call an administration version.

Do you have the user version installed too?

Gilles.
 
If both the Usr and Admin versions are installed, a macro call will launch the version that was installed LAST. If this was the User version, then the macro will fail, as this version cannot open a catalog with the Creator class. You may be able to fix the problem by locating the ImpAdmin.reg file and launching it, which should reset the priority back to the Admin version.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
&quot;Magic with Data&quot;
[pc2]
Want good answers? Read FAQ401-2487 first!
 
I uninstalled the user version from my pc and that worked. now i'm getting another error: Error -91 Object value is set to nothing. I'm getting this on the following line:
Set ObjUserClass = ObjAuthDoc.rootuserclass
Set ObjUserProfile = ObjImpCat.ActiveUserClass
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top