+ Reply to Thread
Results 1 to 4 of 4

help needed Copying data values from closed workbook

  1. #1
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Question help needed Copying data values from closed workbook

    Hi Excel Professionals,

    There is a simple, problem, my file in C:\Test\Report1.xlsx a bit broken,could not open it (not encrypted), That's i need to copy Data from it without opening it cells are A1:C100

    Could you be kind to give a hand to get out of this situation?

    Thank You,
    Akmal

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,704

    Re: help needed Copying data values from closed workbook

    What happens when you try to open it?

    It is possible, but rather complicated, to extract data from a closed file using VBA. It would be much better to fix whatever is preventing the file from opening.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Re: help needed Copying data values from closed workbook

    I tried several recovery options, recommended by microsoft and other web-sites all of them did no effect, and i am writing here in order to find Answer to my questions, in my opinion VBA is the last option...

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,704

    Re: help needed Copying data values from closed workbook

    I'll try to help you but....what happens when you try to open it? If your file is badly corrupted it may be impossible to read it without opening it. I know you've tried a lot of things but if you attach the file someone here may have additional insight as to how to restore your file.

    Here is general-purpose code that will read data from a file without opening it. It uses an approach that was developed for databases but will work with Excel files. It will only retrieve the data, not any formatting. Originally sourced from Ron de Bruin.

    To Call:

    SourceFile: Full path name of the Excel file you want to read
    SourceSheet: Sheet name (as seen on tab) of the sheet you want to read
    SourceRange: A string giving the range you want to read.
    TargetRange: A Range object that says where you want to write the data that you read
    Header, UseHeaderRow: I don't remember how these work. Just use False and False.

    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)

Similar Threads

  1. Export data with two Criteria values from closed workbook to closed workbooks VBA
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2016, 01:56 PM
  2. [SOLVED] Trouble copying data from closed workbook into active workbook, referencing help
    By lepperga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 01:48 PM
  3. Copying data from a closed workbook to an open one
    By buttonmasher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2013, 11:20 AM
  4. [SOLVED] Copying data from a closed workbook into an open workbook ignoring excel filter?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-17-2013, 12:31 AM
  5. Copying Data From Closed Workbook
    By ukhellfire in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-20-2013, 09:49 AM
  6. Replies: 0
    Last Post: 12-14-2012, 12:12 AM
  7. Copying Data From Closed Workbook
    By praetorianprefect in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2011, 02:15 AM

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