Results 1 to 2 of 2

HELP Getting data from closed workbook using VBA code

Threaded View

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question HELP Getting data from closed workbook using VBA code

    Hi,

    I'm getting a Run-time error '91': Object variable or With block variable not set

    Set wb = Workbooks.Open("T:\Data\LMS Leads Conversion.xlsm", True, True)
    ' the sheet in this workbook to copy to
    With ThisWorkbook.Worksheets("LMS Data")
    ' read data from the source workbook
    'the range to copy to in this workbook-name of sheet to copy FROM-range in closed workbook to copy
    .Range("B7", "AR174").Formula = wb.Worksheets("Conversions Summary").Range("C9", "AS176").Formula
    End With

    I managed to use the same code to copy & paste data from another closed workbook without any errors. Should there be any difference when copying the data from xlsx vs xlsm?
    Last edited by persistent83; 04-24-2013 at 05:42 AM. Reason: Need Help

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