en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en nl en en en en en de en en en en en nl en en en en en en en fr en da en en nl en en en en nl en en en en en en en en en en en en nl en en en en en en en en en nl en en en en nl en en en en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in PowerBASIC Console Compiler only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Using Excel 2007 with different charsets - UniCode?
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Join Date: Feb 2008
Using Excel 2007 with different charsets - UniCode?
23 Feb 2008, 08:02 AM
I have an Excel 2007 spredsheet that contains multi language text, most common languages, Dutch, English, French, Hungarian, but also Greec text.
I want to export the contens of this spreadsheet into different database tables (MySQL). For now, without Greec, I manage the spreadsheetdata and save it as to several Tab delimited tables. But the Greec text changes into ask-signs. How can I save it with the powerbasic console compiler into multilanguage files in for instance Unicode text tables?
Join Date: Aug 1998
23 Feb 2008, 06:27 PM
I don't know the COM interface very well, although I do use it to export Excel sheets to tab-delimited text files. (Code is here somewhere, I just copied it and use it).
I'll bet there is some method you can call or value to set to set the text type and/or character set for export to text.. or maybe you will have to get each cell independently and convert it yourself....
.... if you get Unicode Out, you can convert to/from just about anything using the WideCharToMultiByte and/or MultiByteToWideChar Windows' API functions.
Port Washington WI USA
Join Date: Feb 2008
24 Feb 2008, 05:26 AM
Micheal, I'am using it for the same purpose, but now I can't use it because the Greec texts are not Greek anymore in tab-delimited text. I need to know more about all the functions reading cells out of an Excel spreadsheet. When I read the Greec cell and watch the variable (Variant) I only see some Greec chars but merely ask-signs. The type of this Variant is 8 = Dynamic string. I would have it to be Unicode string (31) or perhaps Ansi string (30). How can I change an Excel Cell-type? When I copy the Excel cell and paste it into Notepad and save the textfile I get the warning that it contains Unicode and have to be saved as an Unicode textfile.
I can solve the problem when I can save the spreadsheet in Unicode text from within a PwrBasic Console application.
Last edited by Joost Kant; 24 Feb 2008, 05:39 AM.
Join Date: Mar 2004
24 Feb 2008, 06:29 AM
The type of this Variant is 8 = Dynamic string. I would have it to be Unicode string (31) or perhaps Ansi string (30).
8 (%VT_BSTR) is the correct type: a dynamic unicode string. Your problem is that if you use VARIANT$ to extract the contents it is converted to ansi. You can use the following function to extract the contents in unicode format.
FUNCTION VAR2BSTR (BYVAL vVar AS VARIANT) AS STRING LOCAL s AS STRING LOCAL l AS LONG LOCAL pv AS VARIANTAPI PTR IF VARIANTVT(vVar)   %VT_BSTR THEN EXIT FUNCTION pv = VARPTR(vVar) l = lstrlenW(BYVAL @pv.vd.bstrVal) s = PEEK$(@pv.vd.bstrVal, l * 2) FUNCTION = s END FUNCTION
Join Date: Feb 2008
28 Feb 2008, 02:39 AM
Thanks Jose, My problem is solved!
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 05:45 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.