Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro problem

Hi,

I have a macro that moves particular files after reload, when I manually define the destination path it works fine but when I define the destination path based on the value of a variable it doesn't move the loaded files to the destination path..

Here's the code:

Function FuncMove(file)

SET dest = ActiveDocument.Variables("vDestination")

          destination = dest.GetContent.String -> macro doesn't work if i use this

          'dest = "D:\TAENA KA NOEL\Multi Sheet\LoadedWorkbooks\"  -> when I use this the function works fine

          SET filesys = CreateObject("Scripting.FileSystemObject")

          If filesys.FileExists(file) Then

                    SET fsoFile = filesys.GetFile(file)

                       fsoFile.Move destination

          End If

End Function

1 Reply
qliksus
Specialist II
Specialist II

Use something like

activedocument.variable("dest").setcontent  vDestination.getcontent.string

instead of doing like

SET dest  =  ActiveDocument.Variables("vDestination")

         

  destination = dest.GetContent.String