I was searching the forum, but couldn't find a related post to my question. I really hope you can help me.
Here is the situation: The user clicks on a button. The button triggers a macro opens an excel file on our server, edits it and after that saves it into a specific folder. This works really fine with QlikView Desktop. But on our QlikView Server the macro does absolutely nothing. It never creates an Excel.Application Object nor does it save an excel file into a folder.
This is a short vbscript code just for testing:
Set xls = CreateObject("EXCEL.APPLICATION")
Set wb = xls.Workbooks.Open ("D:\Mediaplanvorlagen\Mediaplan Vorlage_SollIst.xls") xls.Visible = true
thank you for your code. It also works with QlikView Desktop, but unfortunately, when I try it on AJAX Zero Footprint Client on QlikView Server, the code doesn't work. This is the whole problem. I can create and edit simple textfiles, but not excel files.
This code works with AJAX ZfC:
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile("D:\test.txt")
I guess AJAX doesn't allow Excel.Application Objects :/
thank you for your help. I understood that you have limited macro functionality with the AJAX ZfC. But I found a solution!
If you want to export your data into a specific Excel file and Excel automatically do something with the data, you can do the following:
In your QlikView Macro export the data by writing them into a txt file with the "FileSystemObject" properties. With the "WScript.Shell" Object you then can open an Excel file. In that Excel file you have to write a macro which is automatically triggered by opening [Workbook Open event]. Then this macro has to open the txt file with the exported data, writes in into a sheet and finally you have successfully exported the data into excel. The excel-macro can now work with that and create charts, overviews, reports or anything else you want to create.