Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I use a macro to export ma QV table box in excel sheet, but for some value of my field, i have to dont export my table, and write a msg like "This table contain only the bad value".
Some one can help me please.
This is a code of my macro:
....
ActiveDocument.Fields("Activity status").ToggleSelect "Invalid"
ActiveDocument.Fields("Activity status").ToggleSelect "Missing"
'Table box List of Activity
set table = ActiveDocument.GetSheetObject("TB11")
' Copy table and paste into Excel
if(GetPossibleCount(ActiveDocument.Fields("Activity status"))=1 and ActiveDocument.Fields("Activity status") <>"Ok") Then
set XLSheet = XLDoc.Worksheets.Add() 'Select sheet where data should be pasted
XLSheet.Name ="Activity"
table.CopyTableToClipboard true 'Copy data to Clipboard
XLSheet.Paste XLSheet.Range("A1")
XLsheet.Cells.EntireColumn.AutoFit
XLsheet.Cells.EntireRow.AutoFit
else
Print msg "Contain only ok value" in a sheet
end if
....
The If expression dont work and i dont know how to print my msg on a sheet