1 Reply Latest reply: Oct 26, 2014 9:29 AM by Mark O'Donovan RSS

    Exporting a text object to HTML file using macro

      Hi All,

      I have the following macro that works great when the object in qlikview is a table:

      sub exportHTML

      set cs = ActiveDocument.GetSheetObject("CH524")

      cs.ServerSideExportEx "C:\test.html" , ";" , 0 '0=HTML, 1=Text, 2=Bitmap, 3=XML, 4=QVD, 5=BIFF

      end sub


      However, when I try to do the exact same function and the object is a text object,

      I receive an error.


      Can anyone help me to export a text object to html file?




        • Re: Exporting a text object to HTML file using macro
          Mark O'Donovan

          Hi Elula,


          The ServerSideExportEx method does not appear to be available for the text object.

          I check the api files from the following post (API in readable format).


          Here is a script that will use vbscript to save the text to a file. 


          sub exportHTML

          set cs = ActiveDocument.GetSheetObject("TX01")

          msgbox cs.GetText()


          Set objFSO=CreateObject("Scripting.FileSystemObject")


          ' How to write file


          Set objFile = objFSO.CreateTextFile(outFile,True)

          objFile.Write cs.GetText() & vbCrLf



          end sub


          Hope this works for you.