Long time ago I have developed a vbscript application to open qlikview, reduce some data according salesman filter, export the sales pivot table to ex...
Long time ago I have developed a vbscript application to open qlikview, reduce some data according salesman filter, export the sales pivot table to excel and send an email with the excel sheet attached to the salesman using the blat.exe application. The other day i was wondering if the same job could be executed using python. So after two minutes i was googling in search of some code snippets to easily make the python script. After half an hour I was quite disappointed to not found anything already made so I opened Pycharm and started to make the basic code: a class to make an instance of qlikview, open the document, export the table, close the document, close the qlikview app.
Here the code tested on python 3.7:
from win32com.client import Dispatch
self.app = Dispatch('QlikTech.QlikView')
def OpenDoc(self, docname):
doc = self.app.OpenDoc(docname)
def CloseDoc(self, doc):
docname = "c:\EXAMPLE.qvw"
q = QlikView()
version = q.app.QvVersion()
doc = q.OpenDoc(docname)
chart = doc.GetSheetObject("exampletable")
if __name__ == '__main__':
This is the code that I've written at today , for sure i will go on and rewrite all the app to send report attached in emails, if someone need more information, just send me a message.