+ Reply to Thread
Results 1 to 2 of 2

Controlling an outside program from excel macro

  1. #1
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Controlling an outside program from excel macro

    Hi All,

    I have process that i have to do for my company every month. In short what i do is, i open a program on my desktop and run a bunch of reports, those reports all make individual excel workbooks. I have created a macro to run through all of those workbooks, give me the information that i need all summed up in one workbook, and make a final draft of what i need to look at for the company. This process used to take me a total of about a week to do. Well i have shortened that process now with the macro that i have stated. The only thing that i would like to do now is to automate the entire process. Just to create the reports from my external application can take many hours, so i would like to be able to use that time elsewhere. What i am looking for is another macro to access that application from my desktop, i think through the shell function, and then to run all of the reports on its own. The reports all get run the same way each month so i was thinking if there was some way to control the mouse and keyboard basically from excel vba. What i would want to do is when i have the program open i would basically "record" myself running through the process and be able to code it so that the macro will do this. First off is this possible? second could someone write me just a sample of vba to do something like this, maybe using the microsoft notepad as an example where it will open it, type something and then click somewhere that way i can get a real example of every function i would use and be able to curtail it to my needs. Thanks for any help in advance.

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Controlling an outside program from excel macro

    I found my answer, here is some test code.

    This is excel 32 bit code,
    Please Login or Register  to view this content.
    This is 64 bit code
    Please Login or Register  to view this content.
    notice the only difference is in the first 2 lines. Just put this code into a module and give it a try.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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