Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2005, 03:43 PM
Registered User
 
Join Date: May 2005
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!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Unicode UTf-8? System.Text.UTF8Encoding from VBA? forum1 VBScript 11 June 2nd, 2017 05:13 AM
Convert Unicode string to ANSI ashooagarwal .NET Framework 1.x 1 June 7th, 2007 03: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.