Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to paste a text file to excel

Status
Not open for further replies.

Terence

Technical User
Feb 22, 2001
30
US
i have been struggling with this code:

Open "c:\textout.txt" For Input As #1

' run the EOF to get all of the files contents
Do While Not EOF(1)

' set the contents of the file into the variable "strInputLine"
Line Input #1, strInputLine

Loop

' call the excel sheet and set parameters
ExcelSheet.Range("A1:D1").Font.Bold = True

'trying to put contents of text file into excel sheet
objExcel.Activesheet.Paste = strInputLine

this works up to the point of where i am pasteing the file into the excel worksheet. I am getting the variable " strInputLine" in the cell instead of the complete file.


can i do this? or what is the correct way?

thanks in advance! :)-I)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top