Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
qlikviewwizard
Honored Contributor II

Macro disabled

Hi All,

I am getting a message Check if the macro has been disabled.I want to enable the macros used in my qvw application. How to check. Please help to give steps.

Thanks in advance.

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Hi,

The If() is returning the false condition, because the file is not updated today, can you open the file and save it and run the macro again. 

  1.  
  2. if objFile.DateLastModified > cdate((date()) &" 12:00:00 AM"then ' (CDate(now)-1)  then 
  3.   call SendMail2(test, subject2) 
  4. else 
  5.   call SendMailToAdmin("TestReport failed in sending"
  6. End if 

View solution in original post

11 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Hi,

Where you are getting this error?


Try like this

Press Ctrl + M -> and set below options

Requested Module Security ->  System Access

Current Local Security -> Allow System Access

Regards,

Jagan.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Also check this in Qlikview server

QMC -> System -> Setup -> Click on Qlikview Server -> Security -> Select Allow Macro Execution on Server & Allow unsafe macro execution on server options.

Hope this helps you.

Regards,

Jagan.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Check this image

QMC - Macro.png

qlikviewwizard
Honored Contributor II

Re: Macro disabled

Dear Jagan,

Thank you for the answers.

I am using vbscript in macro.

Failing at 13 line....

TestReport failed in sending.

d

VBScript:

dim test

dim subject2

subject2 = "TestReport"

Set objFSO = CreateObject("Scripting.FileSystemObject")

set objFile = objFSO.GetFile("C:\QlikviewReports\TestReport.xlsx")

test = "  - Last Updated on: " & objFile.DateLastModified

if objFile.DateLastModified > cdate((date()) &" 12:00:00 AM")  then ' (CDate(now)-1)  then

  call SendMail2(test, subject2)

else

  call SendMailToAdmin("TestReport failed in sending")

End if

Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Hi,

Do you have SendMailToAdmin() in your script?

Regards,

Jagan.

Highlighted
qlikviewwizard
Honored Contributor II

Re: Macro disabled

Yes.

Here is the part of the script.

Function SendMail2(Result, Subject)

EmailSubject = subject

Const EmailFrom = "Testing"

Const EmailFromName = "Admin"

Const EmailTo = "qlikviewtest@gmail.com"

Dim StrHTML

Highlighted
MVP
MVP

Re: Macro disabled

Yes, but you also need a function SendMailToAdmin().

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
MVP & Luminary
MVP & Luminary

Re: Macro disabled

Hi,

Do you have this SendMailToAdmin()  macro in your QVW file?

Regards,

Jagan.

Highlighted
qlikviewwizard
Honored Contributor II

Re: Macro disabled

Hi Jonathan and Jagan,

SendMailToAdmin function is there. Thank you.