Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master 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
jagan
Luminary Alumni
Luminary Alumni

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
jagan
Luminary Alumni
Luminary Alumni

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.

jagan
Luminary Alumni
Luminary Alumni

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.

jagan
Luminary Alumni
Luminary Alumni

Check this image

QMC - Macro.png

qlikviewwizard
Master II
Master II
Author

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Do you have SendMailToAdmin() in your script?

Regards,

Jagan.

qlikviewwizard
Master II
Master II
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi,

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

Regards,

Jagan.

qlikviewwizard
Master II
Master II
Author

Hi Jonathan and Jagan,

SendMailToAdmin function is there. Thank you.