Results 1 to 2 of 2

Copying data from excel to other programs

Threaded View

  1. #1
    Registered User
    Join Date
    07-14-2015
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    2

    Copying data from excel to other programs

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Declare Function SetForegroundWindow Lib "user32" (ByVal HWnd As Long) As Long
    
    
    Sub Button1_Click()
    
    i = 1
    
    Do Until IsEmpty(Cells(i, 1))
    
    HWnd = FindWindow(vbNullString, "Microsoft Excel - Book1")
    If HWnd Then
    SetForegroundWindow HWnd
    Worksheets(1).Range(Cells(i, 1), Cells(i + 2, 2)).Copy
    End If
    
    
    HWnd = FindWindow(vbNullString, "Untitled - Notepad")
    If HWnd Then
    SetForegroundWindow HWnd
    SendKeys "^v"
    End If
    
    i = i + 3
    Loop
    
    
    End Sub
    

    Hi all,

    I am not sure why the macro does not work properly. I mean, it sometimes copies files as expected, but usually not. Would you advise on that since I have no idea what the culprit is? The aim is to copy data from excel (as a range, 2x3) and paste it into either notepad or other programme.
    Last edited by brzeszczot123; 07-14-2015 at 02:43 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to remove excel programs?
    By burkeiy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2013, 04:32 AM
  2. [SOLVED] Copy and Pasting Data from Excel into External Programs - Quotes being added?
    By MacGyver7640 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2012, 02:27 PM
  3. What other programs can do what Excel does?
    By multimediocrity in forum Excel General
    Replies: 2
    Last Post: 09-09-2009, 03:26 PM
  4. send data between other office programs?
    By Pyrex238 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-16-2007, 01:06 PM
  5. Excel and other programs
    By bwilhite in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2006, 09:22 PM
  6. Excel Programs
    By paulwhyte in forum Excel General
    Replies: 16
    Last Post: 09-08-2006, 01:53 PM
  7. [SOLVED] get data from CMD programs directly into excel e.g. PING
    By Cres in forum Excel General
    Replies: 0
    Last Post: 02-21-2006, 12:40 PM
  8. Excel and other Microsoft programs
    By David A in forum Excel General
    Replies: 0
    Last Post: 01-03-2005, 11:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1