Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
Showing results for 
Search instead for 
Did you mean: 
Specialist II
Specialist II

Macro that runs in Load Script but not in Reload with QMC

Hi guys:

I have a macro function with a param that works fine in Desktop Load Script but it doesn't when reload from QMC, I don't know how to solve it,

This is the macro:

function open_and_save (vFile)

open_and_save = "Inicial"

' Definir el objeto de tipo Aplicación Excel con los parámetros básicos ...

set xlApp = CreateObject("Excel.Application")

xlApp.Visible = false

xlApp.ScreenUpdating = false

xlApp.DisplayAlerts = false

' Definir el objeto libro excel y abrír el fichero ...

xlApp.Workbooks.Open vFile   

Set xlDoc = xlApp.Workbooks(1)

' Guardar y cerrar fichero, Salir de la aplicación ...




' Borrar objetos libro y aplicación ...

set xlDoc = nothing

set xlApp = nothing

open_and_save = "Correcto"

end function

And this is the call to the macro

     LET vRes = open_and_save(vAttachPath);

When I run it with Desktop the value of vRes  is 'Correcto' but when QMC runs the script it fails and this text is in the log file

Error: Unexpected token: '(', expected one of: ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', ...

Any suggest will be appreciated

Thanks in advanced,


1 Reply

As I know it's not possible from QMS