LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code can't locate filename


The following code fails to locate the filename path specified
returning "file not found" error. There is surely a file named
"tester'" in C:\ Mydocuments folder. What gives? TIA


Sub Import_TextFiles1()
Dim RwIndx As Integer
Dim ColIndx As Integer
Dim WholeLine As String
Dim Fname As String

Application.ScreenUpdating = False
ColIndx = ActiveCell.Column
RwIndx = ActiveCell.Row
Fname = "C:\My Documents\tester.doc"
Open Fname For Input Access Read As #1
While Not EOF(1)
Line Input #1, WholeLine
Cells(RwIndx, ColIndx).Value = WholeLine
RwIndx = RwIndx + 1
Wend
Close #1
Application.ScreenUpdating = True


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=387955

 
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
VB Code Help - locate and sum Stan Excel Discussion (Misc queries) 4 April 25th 07 05:33 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
VBA code to locate cell address of AutoFilter dropdown box Dennis Excel Discussion (Misc queries) 3 August 9th 05 10:00 PM
VBA code using Find to locate text and display the Cell Range. slimla Excel Programming 6 May 27th 05 09:55 PM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM


All times are GMT +1. The time now is 09:24 AM.

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"