Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

devarasu07
Honored Contributor II

Running Macro Inside Template?

Hi All,@

I've created an  Nprint Excel template with enabled macros and it should  AutoRun every time the file is opened. However, when NPrinting is creating a report using this template, the macro does not run. But when I go to edit my template inside the report editor, the macro in the background runs without any problems. please refer to the attachment. kindly advise me. THanks

Tags (2)
1 Solution

Accepted Solutions
Employee
Employee

Re: Running Macro Inside Template?

I don't see your macro in the template.

I tested my project again and it works just fine. Remember to Preview as Xlsm:

- Daniel.

5 Replies
woutermak
Contributor III

Re: Running Macro Inside Template?

Isn't it the problem that in the publish task, or preview a .xlsx is used and not a xlsm file?

Only a xlsm can handle marco's

Employee
Employee

Re: Running Macro Inside Template?

Hi Deva,

Since you are on version 16.x, take a look at this example: Index on page loop excel

HTH - Daniel.

devarasu07
Honored Contributor II

Re: Running Macro Inside Template?

Hi djk‌,

I've gone through your post and added below macro into your template after that when i preview the macro not auto running it? but if ran manually and it works . can u advise me. thanks in advance

Sub sbHello()

Range("A1").Value = Range("B9")

End Sub

THanks,

Deva

Employee
Employee

Re: Running Macro Inside Template?

I don't see your macro in the template.

I tested my project again and it works just fine. Remember to Preview as Xlsm:

- Daniel.

devarasu07
Honored Contributor II

Re: Running Macro Inside Template?

Hi djk‌,

Working fine. Tks

Private Sub Workbook_Open()

Call sbHello

End Sub

Option Explicit

Sub sbHello()

Sheet2.Range("A1").Value = "hello"

End Sub

Community Browser