Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 9th, 2005, 04:43 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.Text.UTF8Encoding? Unicode convert?!?

I'm writing VBA code embedded in an Excel spreadsheet.

I need to convert strings from Unicode UTF-8 to standard string objects.

If you read the MSDN docs, it looks like the way is the object System.Text.UTF8Encoding. But it SEEMS like there is no way to use it from the VBA world. It seems like it might be Visual Basic.NET only, but not exported to the VBA world. Is that true?!?!?

How the heck do I do this?

I can create VBA code that does createobject("System.Text.UTF8Encoding") which runs fine, but then the object that it creates can't take any messages. :-(

  Dim myconverter
  Set myconverter = CreateObject("System.Text.UTF8Encoding") ' no error

  Dim encodedBytes
 encodedBytes = myconverter.GetBytes("sdsf") ' THIS FAILS - no GetBytes

There is some commercial developer who licenses some DLL to do this from VBA/VBscript, but that seems ridiculous, and wouldn't work in my architecture anyway -- i need it all to be contained within the Excel file.

Any ideas?!?!

Thanks!

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unicode UTf-8? System.Text.UTF8Encoding from VBA? forum1 VBScript 11 June 2nd, 2017 06:13 AM
Convert Unicode string to ANSI ashooagarwal .NET Framework 1.x 1 June 7th, 2007 04:11 AM
Convert to unicode msoul Classic ASP Basics 2 January 12th, 2007 10:37 AM
unicode text to image rajuru Pro PHP 0 November 9th, 2006 10:40 AM
Visual FoxPro, Rich Text control and Unicode Glamdring VS.NET 2002/2003 0 November 19th, 2004 07:15 AM



All times are GMT -4. The time now is 02:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.