Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist
Specialist

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