This question is similar to many "Notepad posts," but I've not been able to adapt the solutions to my use. Specifically, I'm not trying to write to a text file. I'm trying to use Notepad to strip out HTML formatting before pasting the resulting HTML-free text into a one-column Excel range. (PasteSpecial method is not working reliably in Excel, perhaps due to timing issues or because of control codes in the source.)
I want to do the following from inside a VBA subroutine that runs as a result of a button click in Excel 2007:
1) In the initialization section of the subroutine, open a notepad window. Currently I'm using
2) During the main loop of the subroutine, I get to a point where an entire web page (i.e., the HTML source) is on the windows clipboard. At that point, the code should:
Parameters:
1) The window titles (Notepad and Excel) are fixed and never change.
2) The Excel cells are static and do not change
3) I'm looking for a simple solution that's (hopefully) easy to understand.
Thanks in advance for your assistance.
I want to do the following from inside a VBA subroutine that runs as a result of a button click in Excel 2007:
1) In the initialization section of the subroutine, open a notepad window. Currently I'm using
Code:
Shell "notepad.exe"
2) During the main loop of the subroutine, I get to a point where an entire web page (i.e., the HTML source) is on the windows clipboard. At that point, the code should:
Code:
' Move focus to Notepad window if necessary
' Clear the previous contents of the Notepad window
' Paste Windows clipboard contents to the Notepad window
' Wait for paste to complete, which takes 1 to 60 seconds
' Copy contents of Notepad window to Windows clipboard
' Move focus back to Excel spreadsheet
' Paste Clipboard into a specific cell
Parameters:
1) The window titles (Notepad and Excel) are fixed and never change.
2) The Excel cells are static and do not change
3) I'm looking for a simple solution that's (hopefully) easy to understand.
Thanks in advance for your assistance.
Last edited: