Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Text File no download after reload (Automatically)

Hello,

I have a macro that download an txt file (Works Fine) when I do clic (open Qlikview and after reload the txt file apperas on the specific folder that I have created).

But I have to do this in automatic way, so I created a .bat that reload automatically the qlikview file. But the macro it seems not working.

This is my .bat

@echo off

cd C:\Server Qlikview\Desarrollo\qv_prod

echo Actualizando Datos

"C:\Program Files (x86)\QlikView\qv.exe" /r reload_file.qvw

What I have to do for that the macro run?

It can download a txt file with .bat?

Thanks!

21 Replies
whiteline
Master II
Master II

Hi.

You can try to add /NoSecurity parameter to force the module security.

pgalvezt
Specialist
Specialist
Author

Hi, You mean this? If so, Its not working.

Security.png

whiteline
Master II
Master II

No, Macro module security.

And I mean to add it to the command line.

pgalvezt
Specialist
Specialist
Author

Hi, can you send me how would be that line? or an example please.

This is my macro:

sub Descarga

  'ActiveDocument.ClearAll true

  set PR = ActiveDocument.GetSheetObject("CH04")

  set PR1 = ActiveDocument.GetSheetObject("CH122")

  fecha =  Date

  anio  =  Year(fecha)

  mes   =  Month(fecha)

  'dia   =  Day(fecha)

  dia   =  datepart("d",fecha)

  

  'ActiveDocument.ClearAll false

  ActiveDocument.Fields("fecha").Select anio & mes & dia

  PR.Export "C:\Pro\Valorización_" & anio & "-" & mes & "-" & dia & ".txt", ";"

  PR1.Export "C:\Pro\Comparación_" & anio & "-" & mes & "-" & dia & ".txt", ";"

  'ActiveDocument.ClearAll false

end sub

Thanks!

whiteline
Master II
Master II

"C:\Program Files (x86)\QlikView\qv.exe" /r /NoSecurity reload_file.qvw

pgalvezt
Specialist
Specialist
Author

Hi, this is my .bat file

@echo off

cd C:\Server Qlikview\Desarrollo\qv_prod

echo Actualizando Datos


"C:\Program Files (x86)\QlikView\qv.exe" /r /NoSecurity reload_file.qvw


But is not working,



whiteline
Master II
Master II

cd "C:\Server Qlikview\Desarrollo\qv_prod"

pgalvezt
Specialist
Specialist
Author

cd already exist on the script.

pgalvezt
Specialist
Specialist
Author

I have a .bat that calls another qlikview

(

@echo off

cd C:\Server Qlikview\Desarrollo\qv_prod

echo Actualizando Datos


"C:\Program Files (x86)\QlikView\qv.exe" /r /NoSecurity reload_file.qvw)

called reload_b... Inside reload_b I have a buttom that contain a macro  as follow:

sub Recargar

   set App = ActiveDocument.GetApplication

   set myDoc = App.OpenDoc ("Folder\file_qvw.qvw","user","pass")

   myDoc.Reload

   myDoc.Save

   myDoc.CloseDoc

   set myDoc = nothing

   set App = nothing

end sub

Maybe here is the problem?