Results 1 to 4 of 4
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Read data from closed workbook (Excel 2000)

    Is there a way to read the File/Properties data from a closed workbook? <img src=/S/help.gif border=0 alt=help width=23 height=15> I do not want to have to open the workbook just to read that field (it takes too long and is disruptive to the user of my application to have all these workbooks opening and closing). I know I've seen code somewhere that showed how to read cell data from a closed workbook (anyone know what that code is?) so this seems like it should be possible.

    I need to read the Comments section to determine if this workbook is the one I want to do further processing on. I want to display the list of "approved" workbooks in a ListBox. By approved I mean that they have the 'right' data in their comments field.

    I tried doing this:
    x = application.workbooks("D:somepathmorepathfile.xls" ).BuiltinDocumentProperties("Comments")

    but it failed with 'out of range' error

    The alternative solution (such as it is) is to minimize the windows, open each workbook, read that Comments field, and close it. Then I'll maximize the window so that the user doesn't have to see these workbooks open/close. I know I can do the .ScreenUpdating but I want to truly hide the activity going on, not just minimize screen flicker.

    Thnx, Deb <img src=/S/thankyou.gif border=0 alt=thankyou width=36 height=24>

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Read data from closed workbook (Excel 2000)

    Deb,

    Do a search here and on the Excel forum for "DSO" - I'm pretty sure Andrew Cronnelly posted some usable code for this on the Excel forum quite a while ago.

    Gary

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Read data from closed workbook (Excel 2000)

    Haven't tried this, but it has often been recommended for Word and appears to apply across Office:

    Dsofile.exe Lets You Edit Office Document Properties from Visual Basic and ASP: "Dsofile.exe is a self-extracting executable that provides a simple in-process ActiveX component for programmers to use in order to read and modify the Document Summary Properties for an OLE Structured Storage file such as native Excel, PowerPoint, Microsoft Visio, and Word documents without using Automation to Microsoft Office."

  4. #4
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read data from closed workbook (Excel 2000)

    Re your sub-question "getting data from a cell of a closed workbook": http://www.j-walk.com/ss/excel/tips/tip82.htm
    As for your main question: Dunno

Posting Permissions

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