Hi,
I'm trying to merge edit 2 types of codes...
1. That Opens a notepad file
2. Copies the Data and automatically closes out notepad
Part 2 works if your sending data from an excel sheet to the notepad but I need it to work from oepning a notepadfile directly.
For some reason,
The File will open with no issue but the data on the notepad won't copy.
(I want it to copy (Highlight) blue so after the notepad automatically closes, I can just paste the data to it's destination.
here is the code...
Dim Shex As Object
Set Shex = CreateObject("Shell.Application")
tgtfile = "C:\Folder Location Goes Here"
Shex.Open (tgtfile)
''Start Notepad And let it recieve focus
' Shell "notepad.exe", vbNormalFocus
'Send the keys CTRL+V To Notepad (i.e the window that has focus)
' SendKeys "^V"
'
'Copy whats on the Clipboard
SendKeys "^a"
SendKeys "^c"
waitTime = TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 10)
Application.Wait waitTime
Application.SendKeys "%{F4}", True
Application.SendKeys "{TAB}", True
Application.SendKeys "{ENTER}", True
'End Sub
End Sub
Please Help
Bookmarks