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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Type mismatch error

what's wrong in that code...

it shows type mismatch error....

in

Type mismatch: 'deleteReport'

Type mismatch: 'printReportPDF'

Type mismatch: 'redimarrReports'

code is..

sub sendReport


tempFolder = "c:"

Set oReports = ActiveDocument.Fields("reportID").GetPossibleValues

Dim arrReports()

if oReports.Count > 0 then

redimarrReports(oReports.Count)

for i = 0 to oReports.Count -1

reportID = oReports.Item(i).Text

set rep = ActiveDocument.GetReport(reportID)

reportName = rep.Name

reportFile = tempFolder&reportID& "_" &reportName& ".pdf"

'deleteReport (reportFile) 'Cleaning out any previous report

'arrReports(i) = reportFile

'Print report to PDF

msgbox(reportFile)

printReportPDF reportID, reportFile

' Check the file is printed, before trying to send it

checkOutputFile(reportFile)

next


end if

end sub

2 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

can you attach some application so that we can Test it

vupen
Partner - Creator
Partner - Creator

One possibility is that the variable reportName (that holds the Report Name) has spaces (or logically, a comma). Try replacing spaces with an underscore.

Ex:


reportName = rep.Name
TO
reportName = Replace(rep.Name," ","_")


I believe you have the Sub routenes printReportPDF and checkOutputFile defined in the macro. If they are not existing you would get a similiar error.