+ Reply to Thread
Results 1 to 9 of 9

Macro to Upload data to a different workbook is broken

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Macro to Upload data to a different workbook is broken

    I'm trying to write a Macro to upload data from one workbook called "OutcomeUpload" to the next empty row in "sheet1" on another workbook called "Postings". The code i'm using (below) finds and opens the "Postings" workbook but doesn't upload the data. I've tested the vba by posting to another sheet in the "OutcomeUpload" workbook instead of the "Posting" workbook and that works fine. However when I try to upload to the "postings" workbook I get an error message saying "Run Time Error" "Object doesn't support this property or method".

    Please Login or Register  to view this content.
    the following rows seem to be the problem I think

    Please Login or Register  to view this content.
    Hope you can help
    Last edited by Carling73; 06-28-2013 at 04:44 PM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Macro to Upload data to a different workbook is broken

    where the data start in your file?

    according to this code, it start at row 65536 and column A...

    Set rNextCl = wsData.Cells(65536, 1).End(xlUp).Offset(1, 0)

  3. #3
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Macro to Upload data to a different workbook is broken

    can you upload your file? and tell me which and where the data start you want to copy.

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Re: Macro to Upload data to a different workbook is broken

    Hi Extremis

    File attached below

    The Data starts in D20

    Sample 1.xlsm

    Cheers Mate

  5. #5
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Macro to Upload data to a different workbook is broken

    try this..and in your sample..the data doesnt start in D20 ;/

    Set rNextCl = wsData.Cells(20, 4).End(xlUp).Offset(1, 0)

  6. #6
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Re: Macro to Upload data to a different workbook is broken

    Cheers Extremis

    One more question if I may, how can I get the "Posting" workbook to automatically save and then close once the data has been uploaded. I was going to use the following code after "End With" but before the msg box:-

    Please Login or Register  to view this content.
    But now can't get this to work. Any ideas ???

  7. #7
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Macro to Upload data to a different workbook is broken

    if it,s the active workbook you are working on it would be

    Please Login or Register  to view this content.
    if it's Posting

    Please Login or Register  to view this content.
    i you beleived i help you. Add to my reputation and put a solve on this post

  8. #8
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Macro to Upload data to a different workbook is broken

    *if you believed i Helped you

  9. #9
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Re: Macro to Upload data to a different workbook is broken

    Will do Extremis, I have another question but i'll post on a separate thread so this can be "SOLVED" cheers mate

+ 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