hello
i don’t know if it’s possible, but i want to make new universe in BO using some macros in VBA
i’m the beginner in BO, so don’t be angry
maybe somebody has some materials about it??
My first question is why! The Designer module exists to create universes - you don’t want to reinvent the wheel…perhaps give us some background as to what your requirements are.
my boss asked me to make this kind of macro
today i’ve installed BO on my PC - i’m real beginner
what i know, is when you want to make a big, complex universe you have to “click” many times
maybe making the macro would help
maybe you know any ways to make the new universe ‘automatic’??
That’s not a good way to put it. Designer is THE tool made specifically for building universes. Why would you want to reinvent something that works so well?
ok, maybe i’ll explain what kind of macro i want to make
i have in one universe many parametrs, and no description connected to them
i don’t want to add these description manually, i can export to excel file from database “mapping table”: parametr<->description
and i want to add them automatically - it’d be faster !!
i’ve tried to join BO from VB macro, i used some scripts which i’ve found on Internet, i made sth like that:
Sub Main_()
'Dim ObjDes As New Designer.Application
Dim ObjUniverse As Designer.Universe
Dim i As Integer
Dim UniverseName As String
UniverseName = "/Universe/WHKPI_44"
Set ObjDes = CreateObject("Designer.Application")
Range("A1").Select
ActiveCell.FormulaR1C1 = ObjDes.Version
ObjDes.Visible = True
Call ObjDes.LoginAs("user1", "pass", True)
Set ObjUniverse = ObjDes.Universes.Open(UniverseName)
Call ListColumns(ObjUniverse.Tables)
Call ListTables(ObjUniverse.Tables)
End Sub
Sub ListColumns(Tbls As Designer.Tables)
Dim Tbl As Designer.Table
Dim Col As Designer.Column
Dim Rng As Excel.Range
Dim RowNum As Long
Set Rng = Sheets("Arkusz2").Cells
RowNum = 1
For Each Tbl In Tbls
For Each Col In Tbl.Columns
RowNum = RowNum + 1
Rng(RowNum, 1) = Tbl.Name
Rng(RowNum, 2) = Col.Name
Rng(RowNum, 3) = Col.Type
Next Col
Next Tbl
CleanUp:
Set Col = Nothing
Set Tbl = Nothing
Exit Sub
End Sub
Sub ListTables(Tbls As Designer.Tables)
Dim Tbl As Designer.Table
Dim Rng As Excel.Range
Dim RowNum As Long
Set Rng = Sheets("Arkusz3").Cells
RowNum = 1
For Each Tbl In Tbls
RowNum = RowNum + 1
Rng(RowNum, 1) = Tbl.Name
Next Tbl
CleanUp:
Set Tbl = Nothing
Exit Sub
End Sub
using this code i can only read table_names and col_names from specific universe
is it possible to list also all descriptions???
and change them or add the new one??
i don’t know any functions, etc … ;/
generally i don’t know how to change sth in BO universe using VB
i hope that right now i’ve clearly explained what i want to do,
i think that begginning with BO is not very easy
sorry for my english
thanks for any help !!!
take care
You’re not in good shape… There is a Description attribute that is accessible in the Object class and in the Class class (BO’s naming convention is conflicting with OO programming here…), but if you don’t know VBA, this is not going to do you too much good.
I don’t think your problem is a limitation of the SDK. I think you are restricted by your lack of expertise with VBA. I think you would be better off getting a contractor to pull this off.