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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dabad
Partner - Contributor III
Partner - Contributor III

VBA and Nprinting

Hello everyone ,

I'd like first, to thank everyone, who would take time to read this questions, and reply to it.

I'm trying to add a VBA macro, to an nprinting report( Excel report that contains many sheets), in order to hide a sheet if it empty.

I'm finding a hard time, including the code in Nprinting, each time i copy it and try to register it, i receive this error message :

vba.PNG 

Thank you in advance,

Ps : i  have the june 2019 version of nprinting,

and here is the code i'm trying to implement :

Private Sub Worksheet_Change(ByVal Target As Range)
If Not IsEmpty("Sheet 1[G:G]") Then
Sheets("Sheet1").Visible = True
Else
Sheets("Sheet1").Visible = False
End If
End Sub

Labels (1)
4 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

how about if you create a xlsm file first with your script and then load it as a template. I assume the problem is that you are creating xlsx template and try to embed vb script in it which is not supported.

1.png

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Dabad
Partner - Contributor III
Partner - Contributor III
Author

Thank you for your reply,

 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Does this solve your problem?

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Ruggero_Piccoli
Support
Support

Hi,

I agree with @Lech_Miszkiewicz , you must create and .xlsm template and generate .xlsm report.

Please note that:

  • the .xlsm format is supported since September 2018. Older versions don't support it.
  • Qlik NPrinting 17+ supports only Excel macros. Word and PowerPoint macros are not supported
  • For safety reasons, VBA code is never executed by Qlik NPrinting, it is only copied from the template to the generated report. It is up to you to create, for example, an event based execution or add a button, etc
  • As consequence of previous point, Excel reports with VBA created in PDF format will don't show the macro executed

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.