Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello QV Experts,
Below macro in (first.qvw) will read a text file and writes it to another (recon.qvw) file. The text file contains SQL select statements. I am facing a issue with below code.
1. When I run the macro it just opens the recon.qvw file, but the script is not getting added. Please help.
Thanks in advance
sub UpdateScriptFromfile
set FSO= createobject("Scripting.FilesystemObject")
set openReconFile=FSO.OpenTextFile("C:\Qlikview\buildsql.txt")
scriptBackup=openReconFile.ReadAll
openReconFile.Close
msgbox(scriptBackup)
set newdoc = GetObject("C:\Qlikview\recon.qvw")
newdoc.GetProperties.Script = scriptBackup
end sub
Hi,
Try this.
sub UpdateScriptFromfile
set FSO= createobject("Scripting.FilesystemObject")
set openReconFile=FSO.OpenTextFile("C:\Qlikview\buildsql.txt")
scriptBackup=openReconFile.ReadAll
openReconFile.Close
msgbox(scriptBackup)
set newdoc = GetObject("C:\Qlikview\recon.qvw")
set abc = newdoc.GetProperties
abc.Script = scriptBackup
newdoc.setproperties abc
end sub
Regards,
Kaushik Solanki
Hi,
Try this.
sub UpdateScriptFromfile
set FSO= createobject("Scripting.FilesystemObject")
set openReconFile=FSO.OpenTextFile("C:\Qlikview\buildsql.txt")
scriptBackup=openReconFile.ReadAll
openReconFile.Close
msgbox(scriptBackup)
set newdoc = GetObject("C:\Qlikview\recon.qvw")
set abc = newdoc.GetProperties
abc.Script = scriptBackup
newdoc.setproperties abc
end sub
Regards,
Kaushik Solanki
Thank you so much Kaushik
It worked with your change.