Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Thanked 0 Times in 0 Posts

    Copy&Paste to new workbook (English/Excel 2000)

    I have a macro installed on about 20 office P.C.s that copies information from a working file on their local drive to a "gathering" file on a network drive (using Access for this project is not an option). The macro works well with one odd quirk. Each week the information from one user does not get transferred. It is a different user each week and none of them received any message boxes or other warnings when performing the transfer. I did test the macro when the network file was open and I received the message box stating that the file was unavailable for editing. I've included the portion of the macro that performs the paste operations and am looking for any ideas on why this is happening. THANKS 'opens Worked Permits worksheet
    ChDir "P:"
    Workbooks.Open Filename:="PataWorkedFile.xls"
    'selects cell Al
    'moves to next available row
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    South Carolina, USA
    Thanked 0 Times in 0 Posts

    Re: Copy&Paste to new workbook (English/Excel 2000)

    Depending on what the data in the sheets looks like, there are a couple of things in that code that could be causing some problems. Try using something like the following:

    <pre>Dim oTWB As Workbook, oCell As Range
    Set oTWB = Workbooks.Open(Filename:="C:WorkWorkedFile.xls")
    Set oCell = oTWB.Worksheets("Sheet1").Range("A65536").End(xlUp ).Offset(1, 0)
    oCell.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts