Is there a way in VBAscript to CreateTextFile in UTF-8, or convert a file to UTF-8?
I am using Excel 2010
Is there a way in VBAscript to CreateTextFile in UTF-8, or convert a file to UTF-8?
I am using Excel 2010
Last edited by efratnakash; 01-23-2011 at 05:35 AM.
Maybe something along the lines of:
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
A Google search led to posts that implied saving your workbook in CSV format will suffice as well.
Originally Posted by xenou
A macro said to accomplish the same task:
http://josephtbradley.wordpress.com/...th-no-orphans/
@JBeaucaire: thank you for all your replies, and the link.
I am trying to figure out how to implement it.
Currently I create and open a file, and write line after line (from the sheet data). The name of the output file is sitemap.xml.
I was hoping I could elegantly create a UTF-8 file (means write down the file in UTF-8, as you hinted in your first replies).
Using the function in the link you provided, I understand I should convert the created Unicode file to UTF-8.
If it is not too much to ask, would you please be so kind and update the procedure so it will take full-path-sitemap.xml as an input file, convert and overwrite it as UTF-8?
Many thanks
I think I figured out how to implement the code, but get a Compile error: Object required
The fsT= is highlighted in the second line:
What might be wrong?Please Login or Register to view this content.
Last edited by efratnakash; 01-22-2011 at 02:05 PM.
Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.Please Login or Register to view this content.
Thanks.
Entia non sunt multiplicanda sine necessitate
You don't "set" strings. The fsT variable is DIM'd incorrectly. Take off the "As String" after it...probably should be an object.
(EDIT: hat-tip to shg, that's the ticket)
For:
I get the following error message: Run-time error ‘424’: Object requiredPlease Login or Register to view this content.
Same error when I remove "As String" and stay withPlease Login or Register to view this content.
Last edited by efratnakash; 01-22-2011 at 02:07 PM.
This writes a string to a UTF-8 file.
Please Login or Register to view this content.
It worked!
Thank you sssoooo much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks