Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste into opened notepad file


May i know how do i continue from my code below in order to allow me to
copy sheet3 cells A1:A42 into the opened file? I am able to call
notepad to open the .xml file but i need to paste the data from excel
into this opened file.Thanks!!

Private Sub CommandButton1_Click()
Shell "C:\Windows\Notepad.exe 'C:\project\fyp1.xml"

End Sub


--
oOpsy
------------------------------------------------------------------------
oOpsy's Profile: http://www.excelforum.com/member.php...o&userid=29132
View this thread: http://www.excelforum.com/showthread...hreadid=489798

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste into opened notepad file


any kind soul able to help

--
oOps
-----------------------------------------------------------------------
oOpsy's Profile: http://www.excelforum.com/member.php...fo&userid=2913
View this thread: http://www.excelforum.com/showthread.php?threadid=48979

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Paste into opened notepad file

I don't know how to paste the clipboard contents into another spawned process
as you want. There may be a way to do it, but I would suggest reading about
opening/closing/reading/writing to text files in VB help.

You don't say where you want to paste the cell contents in the file. Below
are two examples. The first one appends the cells to the end of the file.
The second one appends each cell to the end of each line of the text file,
assuming there is one line for each cell.

I did not test these examples, they are simply to give you an idea how to
get started.

' Method 1 - append to end of file

Dim Cell As Range

Open "C:\project\fyp1.xml" For Append As #1

For Each Cell In Sheets("Sheet3").Range("A1:A42")
Print #1, Cell.Text
Next Cell

Close #1

' Method 2 - append to end of each line of file

Dim Rec As String
Dim nRec As Long

Open "C:\project\fyp1.xml" For Input As #1
Open "C:\project\fyp1_NEW.xml" For Output As #2

Do While Not EOF(1)
Line Input #1, Rec
nRec = nRec + 1
Print #1, Rec & Sheets("Sheet3").Cells(nRec, 1).Text
Loop

Close #1
Close #2


"oOpsy" wrote:


any kind soul able to help?


--
oOpsy
------------------------------------------------------------------------
oOpsy's Profile: http://www.excelforum.com/member.php...o&userid=29132
View this thread: http://www.excelforum.com/showthread...hreadid=489798


Reply
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
Notepad or .txt file to excel nathan Excel Worksheet Functions 3 December 1st 09 09:44 PM
Copy and Paste Number from Notepad Carter68 Excel Discussion (Misc queries) 2 January 18th 07 07:56 PM
Writing to notepad file Jeff Excel Discussion (Misc queries) 2 October 23rd 06 03:16 AM
copy excell file to a CSV file and than to Notepad need to know bob Excel Discussion (Misc queries) 0 August 23rd 05 07:27 PM
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM


All times are GMT +1. The time now is 08:29 PM.

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

About Us

"It's about Microsoft Excel"