none
VSTO : Read data from another closed\opened excel file RRS feed

  • Question

  • I have Excel 2010 WorkBook project (Document Level Customization). Lets say the file name is "New.xlsx".

    I have another file called "Old.xls" which contains information in Sheets such as Sheet1 and Sheet2. These sheets are password protected. Also, I have hidden sheets such as Sheet3 and Sheet 4 which contains information. 

    Closed Scenario:

    From New.xlsx file -

    Is it possible to read data for the password protected sheets such as Sheet1 and Sheet2 from Old.xls file which is closed ?

    Is it possible to read data for the hidden sheets such as Sheet3 and Sheet4 from Old.xls file which is closed?

    Open Scenario:

    From New.xlsx file -

    Is it possible to read data for the password protected sheets such as Sheet1 and Sheet2 from Old.xls file which is opened ?

    Is it possible to read data for the hidden sheets such as Sheet3 and Sheet4 from Old.xls file which is opened?

     This needs to be achieved using VSTO.

    Thursday, October 17, 2013 2:33 PM

Answers

  • Even though this needs to be achieved from within a VSTO project, I think the best place to ask about the possibilities would be the Excel for Developers forum.

    VSTO can only extend the capabilities offered by the host Office application. If the host object model doesn't allow something, VSTO isn't able to make it possible. So only approaches that can work, generally, in Excel can work for you in VSTO for this problem.

    For the closed scenario: depending on the format of the data on the sheet it might be possible to use an ADO (OLE DB) data connection? I believe that ignores password protection and "hidden" formatting implemented in the UI (on a sheet, as opposed to the workbook file).


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 17, 2013 4:52 PM
    Moderator