Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Unwanted characters saving to fie

I have a column of digital numbers that I convert yo binaty and samv
to file "SaveBinary.bin". When I convert it back to hex, I have an
extra "0D 0A" added onto the back of the file. This is an extra
carriage return and linefeed the Print # Statement added. I tested it
and it is not part of my data string. This is part of the Print #
Statement? Is there anything I can do?

Sub SaveBinary()
Dim r As Range, c As Range
Dim BinaryString As String
BinaryString = ""
Open "C:\My Documents\SaveBinary.bin" For Output As #1
<snip
Print #1, BinaryString
Close #1
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Unwanted characters saving to fie

If you put a semi-colon at the end of Print or Print # statement, the
newline will be suppressed. If you are printing in a loop, you have to make
sure to do this to the last line only. Change your statement to this...

Print #1, BinaryString;

(Note the semi-colon on the end)

--
Rick (MVP - Excel)


"Fan924" wrote in message
...
I have a column of digital numbers that I convert yo binaty and samv
to file "SaveBinary.bin". When I convert it back to hex, I have an
extra "0D 0A" added onto the back of the file. This is an extra
carriage return and linefeed the Print # Statement added. I tested it
and it is not part of my data string. This is part of the Print #
Statement? Is there anything I can do?

Sub SaveBinary()
Dim r As Range, c As Range
Dim BinaryString As String
BinaryString = ""
Open "C:\My Documents\SaveBinary.bin" For Output As #1
<snip
Print #1, BinaryString
Close #1
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Unwanted characters saving to fie

Thanks! Very grateful. ;)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I remove unwanted characters within a text string. bill Excel Discussion (Misc queries) 2 February 6th 09 01:15 AM
Removing unwanted characters Richard Excel Discussion (Misc queries) 2 June 23rd 06 07:34 PM
Removing unwanted characters jermsalerms Excel Discussion (Misc queries) 15 January 19th 06 09:20 PM
Removing unwanted characters Scorpvin Excel Discussion (Misc queries) 8 December 5th 05 09:07 PM
removing unwanted characters in a cell Andrea[_7_] Excel Programming 3 October 30th 03 07:45 AM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"