Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Export Orders in Excel using Testlab Automation

Siemens Legend Siemens Legend
Siemens Legend

Dear,

 

This is the correct syntax for vba:

 

picman.CopyToClipBoard 0, mc_eBitmap

 

0 = integer, number of picture of you picturemanager

Re: Export Orders in Excel using Testlab Automation

Siemens Legend Siemens Legend
Siemens Legend
Hi NVH_Group,

if you just want to create report you can use also PrintManager (works only with word and ppt).
Then you can use your printformat and fill these with you needed data.

Re: Export Orders in Excel using Testlab Automation

Experimenter
Experimenter

Hi, bvlassa

      Thank you very much !

     Before run the VBA code, I open the TL. I write the code as follow,but the excel still feedback code error.

 

Private Sub CBY()
Dim TL As New LMSTestLabAutomation.Application
Dim mydb As LMSTestLabAutomation.IDatabase
Dim datawatchPictManag As LMSTestLabAutomation.DataWatch
Dim myPictManager As LMSTestLabAutomation.IPictureManager
Dim Color_1 As LMSTestLabAutomation.IBlock2
Dim mypicture1 As LMSTestLabAutomation.IPicture
Dim mydisplay1 As LMSTestLabAutomation.IDisplay
Dim mycopy As LMSTestLabAutomation.IPicture

Set mydb = TL.ActiveBook.Database
Set datawatchPictManag = TL.ActiveBook.FindDataWatch("Navigator_DataViewing_PictureManager")
Set myPictManager = datawatchPictManag.Data
Set mypicture1 = myPictManager.AddPicture("1x1")
'mycopy = myPictManager.CopyToClipBoard(0, mc_eBitmap0 = 1, 1)
mycopy = myPictManager.CopyToClipBoard(0, mc_eBitmap0 = 1, 1)

Sheets("PicSheet").Activate
ActiveSheet.Paste
End Sub

 

Can show me some detials about the syntax ? This problem has confused me several months. I looking forward to you reply.Thank you very much !

Re: Export Orders in Excel using Testlab Automation

Siemens Legend Siemens Legend
Siemens Legend

Dear,

 

I think you syntax of CopyToClipboard is still wrong.

CopyToClipboard has 2 parameters 1)  Index as long/Integer 2) Type as Const_EnumCopyToClipboardType.

In VBA you also don't use the "(" and ")" when using a function.

So correct command is: 

picman.CopyToClipBoard 0, mc_eBitmap

 

CopyToClipBoard is a function of the type Sub, so this returns nothing.

The picture is placed on the Windows Clipboard, we you can take it off.

 

Regards

Re: Export Orders in Excel using Testlab Automation

Experimenter
Experimenter

Hi,bvlassa

      I have copy and paste the display into the excel sucessfully. Thank you very much, you are a real GENIUS .

Re: Export Orders in Excel using Testlab Automation

Valued Contributor
Valued Contributor

Hello,

 

now I am able using VBA to export data (e.g. order curves) from my Testlab project to Excel. However I wonder, if I can also export data from Testlab to Matlab. Are there any ways in achieving that? Either by accessing Testlab via Matlab or by exporting the data from Testlab via VBA into a *.mat-file?

 

Thank you in advance for any help on this.

Re: Export Orders in Excel using Testlab Automation

Siemens Genius Siemens Genius
Siemens Genius

My suggestion is to use Testlab automation to export the data to a .mat file.  While it is possible to do some Testlab automation tasks from a Matlab script, Matlab does not support the Testlab IBlock2 object, so it is not possible to access data directly.

For more info on this, and some sample code, see the previous post:  https://community.plm.automation.siemens.com/t5/Testing-Forum/LMSTestLabAutomation-library-in-Matlab...Smiley Frustrated