DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I call a variable from VBA in Diadem report?

Hello,

 

I have a script in Diadem, script that I can control from a VBA application ( from Excell), and I want to send from Excell some details to the report.

I want in the report, the  Local Test Order field to by the LocalTO from the VBA (Excell), the DVM Test Order fiel to be the DVMTO from Excell, and ..... al the fields from the excell to be in the report.

 

And in the Diadem script the filename of the export .pdf file to be the filename from the Excell.

Attached I put the script from Diadem and the VBA application.

 

Thank you for your time.

0 Kudos
Message 1 of 4
(4,866 Views)

Hello Marse!

 

I can't check your code because the script 'Concatenate Groups.VBS' and some test data is missing!

 

In general there are two ways to show variable content in a REPORT:

  1. Old Fashioned: Use the predifined DIAdem Variables T1-T10/R1-R10/L1-L10 and the @-Syntax in REPORT e.g. @T1@
  2. New Way: Use the command GlobalDim to allocate a variable in the global scope and use the @@-Syntax in REPORT e.g. @@MyVar@@

See for both ways the help for details.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 4
(4,864 Views)

Hi,

 

Thanks for you help, but I want to send (like I said in the previos mail) variable that I declare( write)  in Excell (VBA) to Diadem report.

And the filename variable that I define in Excell to be the name of the report.

This time I've attached all the programs.

 

Thank you again.

0 Kudos
Message 3 of 4
(4,854 Views)

Hello Marse!

 

Sorry that I was not clear enough and add the hwo-to via OLE Smiley Sad

 

For way 1. you have to add this lines to your Excel VBA code:

loadscript = IDIACommand.TextVarSet("T1","Value of T1")

For way 2. it is:

loadscript = IDIACommand.CmdExecuteSync("GlobalDim('MyGlobalVar'")
loadscript = IDIACommand.VariantVarSet("MyGlobalVar","Value of MyGlobalVar")

 

Inserted before your line

loadscript = IDIACommand.CmdExecuteSync("scriptstart('C:\BForce\LIBR\BForce2.VBS')")

Hope it is clear now! Otherwise feel free to ask

 

Matthias

Message Edited by Twigeater on 10-10-2008 09:43 AM
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 4
(4,849 Views)