Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

ateafilar
Not applicable

ANSI coding in textfile from macro

Hi everyone,

I have this macro (VBScript) in which I export a table into a textfile:

Sub ExportToTextfile

    Set tableObject = ActiveDocument.GetSheetObject("TB01")

    tableObject.Export "C:/TEST.txt",Chr(9)

End Sub

My problem is that the exported file has an UTF-8 encoding. I would like to export into ANSI encoding, or convert it into ANSI encoding if possible. Anybody here that knows this?

Best regards,

Filip

Tags (1)
1 Solution

Accepted Solutions
marcus_sommer
Not applicable

Re: ANSI coding in textfile from macro

Maybe it's also connected with the user-properties about the charset within the tab export ...

- Marcus

11 Replies
marcus_sommer
Not applicable

Re: ANSI coding in textfile from macro

There are two further parameter after the delimiter-parameter possible - the codepage and appending to an existing file with true/false.

Codepage number, e.g. :
0          =   current ANSI
1200     =   Unicode
65001   =   UTF-8

- Marcus

ateafilar
Not applicable

Re: ANSI coding in textfile from macro

I don't get it... In what context should I use the 0 codepage?

marcus_sommer
Not applicable

Re: ANSI coding in textfile from macro

...

tableObject.Export "C:/TEST.txt",Chr(9), 0

...

- Marcus

ateafilar
Not applicable

Re: ANSI coding in textfile from macro

Thanks... But unfortunately i still get UTF-8 encoding...

marcus_sommer
Not applicable

Re: ANSI coding in textfile from macro

In regard to the APIGuide.qvw it should work. You could also try it with "ExportEx" - see the picture.

- Marcus

jerrysvensson
Not applicable

Re: ANSI coding in textfile from macro

This works, just tried it.


Sub ExportToTextfile
Set tableObject = ActiveDocument.GetSheetObject("TB28")
tableObject.Export "C:\TEST.txt",",",0
End Sub

ateafilar
Not applicable

Re: ANSI coding in textfile from macro

Doesn't work for me actually, seems strange...

marcus_sommer
Not applicable

Re: ANSI coding in textfile from macro

Maybe it's also connected with the user-properties about the charset within the tab export ...

- Marcus

ateafilar
Not applicable

Re: ANSI coding in textfile from macro

Yes, you are correct Marcus!

Thanks a lot!!

But does this setting affect regular export from charts to excel (such as pivot tables) or only text file exports?

Best,

Filip