+ Reply to Thread
Results 1 to 7 of 7

Loop macro and open external programme

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Loop macro and open external programme

    I have the following which opens notepad from excel

    Please Login or Register  to view this content.
    I also have this which pops up depending on set criteria.

    Please Login or Register  to view this content.
    How can I get macro2 to run, but instead of popping up in a message box, I want whatever would normally popup to be entered into notepad.

    Possible? Any help would be fantastic!

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Loop macro and open external programme

    Change Run_Notepad as shown below and write data to a .txt file and call Run_Notepad similar to Macro2a.
    Please Login or Register  to view this content.
    Post responsibly. Search for excelforum.com

  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Loop macro and open external programme

    That macro works fine for pulling whatever is currently in A1 and A2 but if you look at my loop code above I want it to write data to notepad based on what would popup in the macro2 I have above.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Loop macro and open external programme

    My code was just an example to show the technique. I thought you would be able to adapt your code to work in a similar way, for example depending on how you want it to work you could replace the MsgBox line with the following 6 lines:
    Please Login or Register  to view this content.
    Or, if you want you put all values in one file and open that file in Notepad, put the Open, Close and Run_Notepad outside the loop. I'm sure you can work it out with the help I've given.

  5. #5
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Loop macro and open external programme

    Yes I want all the data to be in one file that is opened in notepad. I'll give it a go later when i'm home. Thanks for your help so far! Much appreciated.

  6. #6
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Loop macro and open external programme

    Ok, so I can get it to work fine but it opens multiple notepads. How can I get it all in one instance of notepad?

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Loop macro and open external programme

    Ah I only noticed your comment saying put open.close/run outside the loop! Works perfect. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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