+ Reply to Thread
Results 1 to 11 of 11

Wait for Notepad to open file

  1. #1
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    Wait for Notepad to open file

    Hi, Looking to change up my code it doesn't stop and wait for the file to open so the send keys doesn't work.
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Wait for Notepad to open file

    Hello jimrosser,

    It is seldom necessary to have select or activate objects in VBA before using them.

    If you can explain in words what you are doing then we can find a solution for you.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    Re: Wait for Notepad to open file

    All the macro is trying to do is primarily open and save the file depending on the date. It will run a total of 10 times. It has no problem with smaller files but one it reaches some of size it begins to open the additional files and skips the sendkeys function.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Wait for Notepad to open file

    Hello jimrosser,

    All the macro is trying to do is primarily open and save the file depending on the date.
    That's the part that doesn't make sense to me. Are you wanting to change the last modified date of the most recent file?

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Wait for Notepad to open file

    If your attempting to Open/Edit/Close text files then you should look at the commands that involve opening files for input

    example colde here shows "Open .. for Input" method to open and edit text files.

    F1 = FreeFile
    Open SourceFile For Input As F1

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    Re: Wait for Notepad to open file

    The files are being sent down from a server and some of the data is garbled. So the only way to fix the files is to manually open and save the files. However I'd like to be able to do this without having to manually sit and wait each morning.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Wait for Notepad to open file

    Hello jimrosser,

    This will open and the close the file without using Notepad or having to wait.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    Re: Wait for Notepad to open file

    Thanks Leith! It's like a rocketship compared to what I was attempting to run.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Wait for Notepad to open file

    Hello jimrosser,

    You're welcome.

  10. #10
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    Re: Wait for Notepad to open file

    Still having issues as the way the files are written they must be opened in notepad to remove the hard returns and other garbage that's being passed down.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Wait for Notepad to open file

    Hello jimrosser,

    To solve this problem, I need a copy of the raw data for testing. Without a before and after files for comparison, I can do nothing for you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. if file is open - try again, wait, try again
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2014, 10:39 AM
  2. Open with Notepad Issue after saving CSV
    By aaron.mendes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-06-2014, 09:45 AM
  3. Wait for user to open new file
    By bishope in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2013, 03:47 PM
  4. [SOLVED] How to know if a file (notepad) is open?
    By keymuu in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-03-2012, 02:36 AM
  5. Wait if application open
    By astrikor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2010, 01:27 PM

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