Sie sind hier

com interface

Allgemeine Diskussion » com interface Posted: 17. März 2021 - 7:32

Hi ,

 

I am trying to automate the task of inputting the values in conval control valve by using Excel com interface. I am stuck in  print procedure for printing the calculation in pdf format in a perticular folder.

will be very helpful if you can provide me with some examples.

Thanks & Regards

Devkumar Chatterjee

BASF India

Kommentare

Michael Welsch

Bild des Benutzers Michael Welsch

Pdf creation in Com Interface

Posted: 17.03.2021 - 10:32

Hi,

for printing or pdf, export use the dialog instead of the calculation interface. In fact, the calculation interface is part of the dialog interface:

Option Explicit 
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 

Dim CV As COMConval10.Conval10 
Dim CVCalculation As COMConval10.Calculation 
Dim CVDialog As COMConval10.CalculationDialog 

Set CV = New Conval10           'Command to start the CONVAL-COM server 
Sleep 1000                      '1 second break to ensure that the COM server is fully started 
Set CVDialog = CV.NewDialog(1)  '1 = Control valve 
Set CVCalculation = CVDialog.Calculation 
CVCalculation.CalculationData.ParamByName("t1").Value = 10
...
CVDialog.CreatePdf(<filename>)

Best Regards
MW