Using a script to export an QV object to Excel or JPG
I met some problems using a script to export an or more object(s) to Excel or JPG for example.
My problem was, when I have more one selection, selected by script, some time you unselect one selection because you don't have any records for these selections. When you use QV manually, easy to look about this, but by script ?
I found one solution for this problem. You have to test every time you select a new one if you have already some records for these selections.
This is my PowerShell script
#Select new one selection
$objQVDoc.Fields("Type de commande").Select("CDE")
#Test if the selections are already active for each selection done, in this case tree selections
#I use the variable '$testsel', if is ok, I receive 0, if I don't have any records, I receive -1