DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Error

Solved!
Go to solution

Hello,

I have the script attached on the picture, actually, i wrote it to decrease automatically the size of the characters which is defined  in the masterlayout. the problem is that diadem displays this error : No object with the specified name exists , this is in the line : set octrl = Report.sheets..(text2) , 

Any help please ? 

0 Kudos
Message 1 of 13
(4,478 Views)

Hi,

 

have you declared it at the beginning of the script using Dim?

0 Kudos
Message 2 of 13
(4,445 Views)

thank you for your answer , Yes , it's the first line in the picture ,

0 Kudos
Message 3 of 13
(4,442 Views)

In which column is the error?

Also, are you sure you have Text2 in the Report?

0 Kudos
Message 4 of 13
(4,436 Views)

Hi,

The error is in the 6th row , the 'text2' is actually defined in the master layout 

0 Kudos
Message 5 of 13
(4,413 Views)

Maybe it should be like that?:

Set oCtrl = Report.Sheets("Landscape Master").Objects.Item("Text2").ObjectType
0 Kudos
Message 6 of 13
(4,405 Views)

If you connect your master layout to a normal tdr layout which is loaded at the same time you execute your script, it will not work.

For your script the "Landscape Master" sheet only exists if your master layout tdrm file is actually opened in report module (connecting it in your tdr file is not enough here).

I think by design there is no way to access the text object of the master layout if your normal tdr layout is opened.

A master layout is meant to be the same for every tdr layout that's connected to it.

Why create a master layout in the first place if it's looking different in every other tdr layout later?

Christian
CLA, CTA, CLED
0 Kudos
Message 7 of 13
(4,396 Views)

Hi Say,

 

The only option I can find is to first load the master layout file, make your edits, then resave the master layout file, THEN load the dependent TDR file (make sure it's set up to load the master layout info each time).  You can perform all these steps programmatically like this:

 

LayoutPath = CurrentScriptPath & "Example.TDR"
MasterPath = CurrentScriptPath & "Example.TDRM"
Call Report.LoadMasterLayout(MasterPath)
Set oCtrl = Report.Sheets("Landscape Master").Objects("Text4")
oCtrl.Font.Size = oCtrl.Font.Size - 2
Call Report.Refresh
Call Report.SaveMasterLayout(MasterPath)
Call Report.LoadLayout(LayoutPath)
Call Report.Refresh

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 8 of 13
(4,377 Views)

Hello,

Thank you for your answer , i tried this method but it displays the error showed in the logfile in  the picture attached, any idea please?

0 Kudos
Message 9 of 13
(4,363 Views)

Hello Brad,

Well , i think it 's fine for running, but i still have one problem, the masterlayout configured(where the fond size is modified) is not displayed with the layout  when i run the script, i still have no change . the configuration is actually made  in the initial Masterlayout . 

Any ideas please ? 😞

Attached the final script that i made 

0 Kudos
Message 10 of 13
(4,351 Views)