View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Darren Hill[_2_] Darren Hill[_2_] is offline
external usenet poster
 
Posts: 80
Default Is it possible to activate a txt document in excel code?

The following page gives macros for using text files effectively - I had a
problem similar to yours earlier this week.
http://www.cpearson.com/excel/imptext.htm

--
Darren
"Together " wrote in message
...
Hi,

I have some excel file, with some number in excel cells. Each single
figure in some cells. Of couse, there are some cells without any
content. My objective, is to let the figure in cells to be character in
text file, and let null cell to be space in text file. I can use
variables to transfer the data in excel to text. But there are another
problem appearing. I can not open text file in excel VB editor. Here is
my code:

Sub macr()
Dim i, j As Integer
Dim value As String

For i = 1 To 65
For j = 1 To 80
value = ActiveWorkbook.Sheets(1).Cells(i, j).value
Documents.Open Filename:="D:\VB\Code for TRF"
Activedocument.Paragraphs(i).Range.Characters(j).T ext = value

Next j
Next i

End Sub

It seems that the function "Document. Open" is not validaty, and I can
not open the "Code for TRF" file in the code. How to modify the code.
Thank you.


---
Message posted from http://www.ExcelForum.com/