473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Downloading Unicode Text from txt file into excel collumn

1
I'm trying to read Unicode from file correctly using VBA. However I managed read correctly only first string. Code:

Sub ReadTextFile()
Dim Buffer
Dim FSO As FileSystemObject
Dim FSOFile As TextStream
Dim FilePath As String
r = 1

FilePath = "C:\text.txt"

Set FSO = New FileSystemObject
If FSO.FileExists(FilePath) Then
Set FSOFile = FSO.OpenTextFile(FilePath, 1, False)
Buffer = vbNullString
Do While Not FSOFile.AtEndOfStream
Buffer = FSOFile.ReadLine()
ThisWorkbook.Worksheets(1).Cells(r, 1).Value = StrConv(Buffer, vbFromUnicode)
r = r + 1
Loop
FSOFile.Close
Else
MsgBox (FilePath & " does not exist")
End If
End Sub


I know it shouldn't be difficult but I'm trying second day without any progress. Does smb have any suggestions or solution?

Thanks
Attached Files
File Type: txt text.txt (74 Bytes, 368 views)
Mar 25 '12 #1
1 2478
Guido Geurs
767 Expert 512MB
On the site:
http://oreilly.com/catalog/win32api/chapter/ch06.html
is a good explanation of the different types of string in VB.
Mar 28 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: burdeen | last post by:
I can't find any way of writing a unicode, or UTF-8 format text file. Right now i have a Unicode string that i write to the text file and the unicode characters are replaced with ANSI question...
0
by: JohnBon | last post by:
Hi Is it possible to get information from a database and generate it to unicode text files using ASP? Is there any product/COM out there that can do this? If not, is there any other...
6
by: dbaldi | last post by:
(this is follow-on message to one posted yesterday) I'm trying to reproduce the capabilities in both Notepad and Excel, whereby a Unicode text file with Unicode characters can be converted to...
1
by: Eilsa | last post by:
I have a text file which is UTF-8 encoding. How can I read it from the ASP? Thanks
14
by: Koulbak | last post by:
I have some unicode (utf8) text file. I _tried_ to write a simple program that read one of them and write it to the standard output but... of course it doesn't work. There is an easy way to do it?...
1
by: Rob | last post by:
I would like to download a text file on a web server, and use the contents of the file as data input. The file can theoretically be accessed from internet explorer using the address...
1
by: markww | last post by:
Hi, I'm just trying to print the contents of a notepad file I saved with unicode encoding on my win xp machine. I keep getting strange characters printed out though. Why doesn't this work? ...
8
by: Mariii | last post by:
Hello All! I have a problem with reading unicode txt file from VC++ project. I despaired already. :( May be you could help me? Thank a lot in advance, Marina
3
by: lerougegorge | last post by:
When I pull a string from a UTF-8 encoded field in my SQL, I get a string like the following: "& #2342;& #2369;& #2312;" (I have inserted a space between "&" and "#" to stop this from...
8
by: jyaseen | last post by:
I used the follwing code to download the text file from my server location. my php file to read the following code name is contacts.php it is downloading the text file but , this text file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.