LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default The Print # command print not all rows from excel sheet to file

This line :
Print #OutFile, Replace(Input(LOF(InFile), #InFile), "1LS-Arial",
"1LS-OCR-B-10 BT")

needs to be all one line. The news reader wrapped it.

NickHK

"NickHK" wrote in message
...
I can't repeat your error(s) using this code your XML file.
It replaces fine, no Chinese or errors.

Dim InFile As Long
Dim OutFile As Long

InFile = FreeFile
Open "C:\Replace.txt" For Input As #InFile

OutFile = FreeFile
Open "C:\outdat.txt" For Output As #OutFile

Print #OutFile, Replace(Input(LOF(InFile), #InFile), "1LS-Arial",
"1LS-OCR-B-10 BT")

Close #InFile
Close #OutFile

As for the files, whilst they may be text, they can still be saved in a
Unicode format. Open in NotePad, do a SaveAs and check the Encoding

setting.
However, I get different errors to those you mentioned if the file is
Unicode.

NickHK

"pieros" wrote in message
oups.com...
Good morning NickHK (It now is here about 08:40 am),

My text files are good readable characters. Here is an example:

<?xml version="1.0"?
<DynaMark-Project title="Sjabloon_40mm_Rb.xml" version="0.1"
<Dynamark-Object type="CObjText"
<CObjBaseData template-version="0.1"
<ObjName type="CString"ExpDate</ObjName
<ParamDelaysName type="CString"KM09standaard</ParamDelaysName
<Invers type="bool" value="false"/
<Mark type="bool" value="true"/
<Offset type="CPoint" value="-1908788 -725252"/
<ScaleX type="double" value="1.8"/
<ScaleY type="double" value="2.2"/
<RadiantX type="double" value="-1.5708"/
<RadiantY type="double" value="-1.5708"/
<MirrorX type="bool" value="true"/
<MirrorY type="bool" value="true"/
<LaserNr type="int" value="0"/
<MinVectorLength type="double" value="0"/
<XCenterMode type="int" value="0"/
<YCenterMode type="int" value="0"/</CObjBaseData
<CObjText
<Text type="CString"2222222</Text
<FontName type="CString"1LS-Arial</FontName

And than about 100 - 120 lines for each file.
So there seems nothing wrong with the text.

My goal is to replace the text 1LS-Arial or 1LS-Arial-U in 1LS-OCR-B-10
BT in each file but in some files the text 1LS-OCR-B-10 BT is already
present so needs no modification.

Pieros.





 
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
command line options/switches to print excel file Stranger[_2_] Excel Worksheet Functions 2 March 18th 09 06:36 AM
command line options/switches to print excel file Stranger[_2_] Excel Discussion (Misc queries) 1 March 17th 09 01:04 PM
how to print a sheet by command ghost Excel Discussion (Misc queries) 4 May 1st 07 05:33 PM
How to format the extension less file to print with Dos's Print Command Badshah Excel Discussion (Misc queries) 0 November 28th 06 12:44 PM
Create command button to print multiple worksheets in a excel file MarcoR Excel Discussion (Misc queries) 3 June 26th 06 07:07 PM


All times are GMT +1. The time now is 12:31 PM.

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

About Us

"It's about Microsoft Excel"