Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use macro to print msg in excel sheet

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.

1 Reply
Not applicable
Author

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