+ Reply to Thread
Results 1 to 3 of 3

Alternative to Sendkeys when manipulating a file in Notepad?

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    work
    MS-Off Ver
    Excel 2010
    Posts
    15

    Alternative to Sendkeys when manipulating a file in Notepad?

    I must create a process that FTPs a CSV file. The table receiving the file has been structured so that it rejects all files with blank rows (this is out of my control). Saving Excel files as .csv retains a blank row I cannot access or delete in any MS Office application. I can only view and delete this blank row in Notepad.

    I have altered the proposed process so that:
    Saves the file as .csv
    Opens the file in Notepad
    strikes "CTRL + END" via the sendkeys function to move the cursor to the end of the file
    strikes "BACKSPACE" via sendkeys to delete the final row
    strikes "CTRL + S" via sendkeys to save the file
    strikes "ALT + F4" via sendkeys to close Notepad

    The process then resumes as normal to FTP the file.

    I have two questions.

    Can you think of any reason why this method is unreliable or volatile?

    Is there a better way to delete that final hidden row?

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Alternative to Sendkeys when manipulating a file in Notepad?

    you can export as csv without using save as with a code like this
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    work
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Alternative to Sendkeys when manipulating a file in Notepad?

    Thanks for you help on this. I'm having some difficulty tailoring your code to my needs. The number of records and ranges will change each month. To further complication the process the range copied is rarely contiguous.

    Here's what I currently have that creates the .csv file:
    Please Login or Register  to view this content.

+ 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