Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is it possible to activate a txt document in excel code?
Hi,
I have some excel file, with some number in excel cells. Each singl figure in some cells. Of couse, there are some cells without an content. My objective, is to let the figure in cells to be character i text file, and let null cell to be space in text file. I can us variables to transfer the data in excel to text. But there are anothe problem appearing. I can not open text file in excel VB editor. Here i 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 ca not open the "Code for TRF" file in the code. How to modify the code Thank you -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Code On Activate | Excel Worksheet Functions | |||
Activate menus for Office document opened in IE | Excel Discussion (Misc queries) | |||
How do I activate Document Version management in Excel just like . | Excel Discussion (Misc queries) | |||
using excel macro to activate word document | Excel Programming | |||
Embedded Word Document not painted until I click on it and activate it with the mouse | Excel Programming |