Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

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?

thanks,

Ella

1 Reply
markodonovan
Valued Contributor

Re: Exporting a text object to HTML file using macro

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

outFile="c:\test.html"

Set objFile = objFSO.CreateTextFile(outFile,True)

objFile.Write cs.GetText() & vbCrLf

objFile.Close

end sub

Hope this works for you.

Thanks

Mark

www.techstuffy.com

Community Browser