Update 23-Oct-2009: Another version that can change CLASS names and descriptions can be found here later in this thread.
Author: Dwayne Hoffpauir, EDS Corporation
Further discussion on this utility should take place in this topic.
Author Notes:
Option Explicit 'require variables to be declared before being used
Dim DesignerApp As Designer.Application
Dim Univ As Designer.Universe
Dim Wksht As Excel.Worksheet
Sub GetInfo()
Set DesignerApp = New Designer.Application
DesignerApp.Visible = True
Call DesignerApp.LoginAs
Set Univ = DesignerApp.Universes.Open
DesignerApp.Visible = False
Set Wksht = ThisWorkbook.Worksheets("Objects")
Wksht.Unprotect
Range("Objects").ClearContents
Call GetObjectInfo(Univ.Classes, 1)
Range("Objects").Resize(Wksht.UsedRange.Rows.Count - 1, 5).Name = "Objects"
Range("Objects").Columns("D:E").Value = Range("Objects").Columns("B:C").Value
Wksht.Protect
DesignerApp.Quit
Set DesignerApp = Nothing
End Sub
Sub MakeChanges()
Dim RowNum As Long
Dim Cls As Designer.Class
Dim Obj As Designer.Object
Dim Rng As Excel.Range
Set DesignerApp = New Designer.Application
DesignerApp.Visible = True
Call DesignerApp.LoginAs
Set Univ = DesignerApp.Universes.Open
Set Wksht = ThisWorkbook.Worksheets("Objects")
Set Rng = Wksht.Range("Objects")
For RowNum = 1 To Rng.Rows.Count
Set Cls = Univ.Classes.FindClass(Rng.Cells(RowNum, 1).Value)
Set Obj = Cls.Objects(Rng.Cells(RowNum, 2).Value)
If Obj.Name <> Rng.Cells(RowNum, 4) Then Obj.Name = Rng.Cells(RowNum, 4)
Obj.Description = Rng.Cells(RowNum, 5)
Next RowNum
End Sub
Private Sub GetObjectInfo(Clss, RowNum As Long)
Dim Cls As Designer.Class
Dim Obj As Designer.Object
For Each Cls In Clss
For Each Obj In Cls.Objects
RowNum = RowNum + 1
Wksht.Cells(RowNum, 1) = Cls.Name
Wksht.Cells(RowNum, 2) = Obj.Name
Wksht.Cells(RowNum, 3) = Obj.Description
Next Obj
If Cls.Classes.Count > 0 Then
Call GetObjectInfo(Cls.Classes, RowNum)
End If
Next Cls
End Sub
Adding a version of the utility for Designer XI. I’ve only tested it with XIr2, so I’m not sure if it will work with XIr1. The only changes are to point to the XI library (Tools, References), and to reflect the syntax change for the logon dialog (.LogonDialog instead of .LoginAs). UniverseDescriptionsXI.zip (10.0 KB)
This is great. I am trying to modify it, to include the SELECT part from Designer too and it keeps throwing up a “Out of Memory” error. I am using this in XIR3. If the code is tun without any changes then it executes perfectly fine, but when i make the change to include the SELECT it throws up the error.
The changes I made were as follows:
Sub GetInfo()
Range(“Objects”).Resize(Wksht.UsedRange.Rows.Count - 1, 7).Name = “Objects”
Range(“Objects”).Columns(“E:G”).Value = Range(“Objects”).Columns(“B: D”).Value
Sub MakeChanges()
If Obj.Name <> Rng.Cells(RowNum, 5) Then Obj.Name = Rng.Cells(RowNum, 5)
Obj.Description = Rng.Cells(RowNum, 6)
Obj.Select = Rng.Cells(RowNum, 7)
Private Sub GetObjectInfo(Clss, RowNum As Long)
Wksht.Cells(RowNum, 4) = Obj.Select
I would really appreciate if you can let em know where I am erring. Also, it does not return the full list of objects too. I mean, I have close to 290 objects in the Universe and the changed code stops at row 171 ( the original code returns all 290 objects though)
I’ve seen that “out of memory” error reported when the length of the string is > 1024 characters. Try this, and see if the error goes away …
Left(Obj.Select, 1024) = Rng.Cells(RowNum, 7)
Then change it to 1025, and see if the error returns. I don’t have a solution (other than adding a loop to split into “chunks” of 1024 per cell), but at least that will point out the Excel limitation causing the problem.
Sorry for the late response. I tried doing what you asked me to, but that stil did not help. I also tried to look at the length of the string for each object (Select) in the Universe and the max length that a few objects have are 623 charecters. This is a whole lot less that the 1024 that I was trying to put as a restraint.
It should work with Excel 2007 as well … at least according to tech support. It’s not working on my workstation with Excel 2007, but it’s probably something to do with my machine.
did you find any solution for that problem? Im working at a customers company and they restricted access to a lot of things … i get the runtime error 430 as well, with Excel 2007. Any idea what i can try?
I did find a solution … got a new computer 8) !!! Kidding of course. I have no idea exactly what was causing the issue. All I know is that it works flawlessly now with Vista / Excel 2007. If you log a tech support case (or whatever they are called now), they can provide you with a “logging” utility that may help them debug your issue.
My visual basic references are ticked for “Business Objects Designer 11.5 Object Library”. I am using Excel 2003 with BO XIR2 SP4. I don’t know what I am doing wrong, If you can help that would be great.
Great tool! It has saved me 1-2 days of work. I made the changes in object names and their descriptions in 30 minutes (including download of the utility, and reading how to use it).
One suggestion though:
It would be prefect if the utility was capable of renaming class names and class descriptions too