Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

ronaldwang
Contributor III

Nprinting with external macro

I have an Nprinting to export pivot table in to excel report. as i am not happy with the formatting so i can have some VBA written to change the format to what i want. will i be able to incorporate this macro into Nprint so that the output will be updated with the VBA to the format that i want? will be good if any example link can be shared

Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: Nprinting with external macro

Hi,

What version of Qlik NPrinting are you using?

As you can see in the first page of the help site https://help.qlik.com/en-US/nprinting/February2018/Content/Introduction/Introduction.htm Qlik NPrinting 16 supports Microsoft Office macros but Qli NPrinting 17 at the moment (February 2018) doesn't support Office macros.

So, if you are using the 17 you cannot add macros.

If you are using Qlik NPrinting 16 you can create an Office template that supports macros, for example an .xlsm file. Insert the VBA code in it and the code will be copied in all the output reports. The VBA code is never executed by Qlik NPrinting for security reasons. The recipient have to run the macro by himself or you can associate it with the opening event.

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 as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



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.

View solution in original post

5 Replies
Employee
Employee

Re: Nprinting with external macro

Hi,

What version of Qlik NPrinting are you using?

As you can see in the first page of the help site https://help.qlik.com/en-US/nprinting/February2018/Content/Introduction/Introduction.htm Qlik NPrinting 16 supports Microsoft Office macros but Qli NPrinting 17 at the moment (February 2018) doesn't support Office macros.

So, if you are using the 17 you cannot add macros.

If you are using Qlik NPrinting 16 you can create an Office template that supports macros, for example an .xlsm file. Insert the VBA code in it and the code will be copied in all the output reports. The VBA code is never executed by Qlik NPrinting for security reasons. The recipient have to run the macro by himself or you can associate it with the opening event.

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 as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



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.

View solution in original post

ronaldwang
Contributor III

Re: Nprinting with external macro

Hi Ruggero,

I have created template that supports macros, but the Nprint seems to remove the macro during the process as the output will not have macro anymore, any idea? thanks

Support
Support

Re: Nprinting with external macro

Hi,

What version of NPrinting are you using? If 17.x or 18.x, as Ruggero mentioned above, macro enabled Office reports (XLSM, DOCM, PPTM) are not supported. If using 16.x, you need to set the output to the correct format. Example: Index on page loop excel

HTH - Daniel.

ronaldwang
Contributor III

Re: Nprinting with external macro

thanks, I am using the 16. it must be the output format issue

Employee
Employee

Re: Nprinting with external macro

Yes, in Qlik NPrinting 16 you must create a template in a format that supports macro (for example .xlsm) and select and output format that also supports macros (for example .xlsm).

If you select and output format that doesn't support macros the code will be removed.

Remember also that macros are never executed by Qlik NPrinting so:

- the user must manually run them

- as alternative you can trigger them on opening so it seems that they were executed

- if you select PDF as output format it will be generated without macros actions



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.