Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Maybe it's also connected with the user-properties about the charset within the tab export ...
- Marcus
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
I don't get it... In what context should I use the 0 codepage?
...
tableObject.Export "C:/TEST.txt",Chr(9), 0
...
- Marcus
Thanks... But unfortunately i still get UTF-8 encoding...
In regard to the APIGuide.qvw it should work. You could also try it with "ExportEx" - see the picture.
- Marcus
This works, just tried it.
Sub ExportToTextfile
Set tableObject = ActiveDocument.GetSheetObject("TB28")
tableObject.Export "C:\TEST.txt",",",0
End Sub
Doesn't work for me actually, seems strange...
Maybe it's also connected with the user-properties about the charset within the tab export ...
- Marcus
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