Open password protected Excel workbook in Visual Basic - basic.visual

This is a discussion on Open password protected Excel workbook in Visual Basic - basic.visual ; Hello, My VB 6.0 application read and writes data from and to a MS Excel workbook, using the Microsoft.Jet.OLEDB.4.0 provider. Now I want to protect the Excel workbook with a password, but I figured out that it is not possible ...

+ Reply to Thread
Results 1 to 7 of 7

Open password protected Excel workbook in Visual Basic

  1. Default Open password protected Excel workbook in Visual Basic

    Hello,

    My VB 6.0 application read and writes data from and to a MS Excel workbook,
    using the Microsoft.Jet.OLEDB.4.0 provider.

    Now I want to protect the Excel workbook with a password, but I figured out
    that it is not possible to open the workbook for data access with ADO
    (http://support.microsoft.com/?KBID=211378).

    Is there another way to use a password protected Excel workbook in my
    application?

    Regards,

    Geert-Pieter



  2. Default Re: Open password protected Excel workbook in Visual Basic

    If you know the password, you should be able to use it via the the MS Excel
    Object Model.

    Here's a link to the 2000 documentation
    http://msdn.microsoft.com/library/en...tmodelguide.as
    p?frame=true
    http://msdn.microsoft.com/library/de...us/odeomg/html
    /deovrmicrosoftexcel2000.asp

    Good luck,
    --
    John MacIntyre
    VC++ / VB / ASP / Database Developer
    http://www.johnmacintyre.ca


    "Geert-Pieter Hof" <g.p.m.hof@wbmt.tudelft.nl.blablabla> wrote in message
    news:bj7m4d$kp1$1@azure.qinip.net...
    > Hello,
    >
    > My VB 6.0 application read and writes data from and to a MS Excel

    workbook,
    > using the Microsoft.Jet.OLEDB.4.0 provider.
    >
    > Now I want to protect the Excel workbook with a password, but I figured

    out
    > that it is not possible to open the workbook for data access with ADO
    > (http://support.microsoft.com/?KBID=211378).
    >
    > Is there another way to use a password protected Excel workbook in my
    > application?
    >
    > Regards,
    >
    > Geert-Pieter
    >
    >




  3. Default Re: Open password protected Excel workbook in Visual Basic

    According to MS Knowledge Base Article 249843, the MS Excel Object library
    is not redistributable. So I cannot the mentioned solution on computers that
    haven't got MS Excel installed.

    So, is there another way to read data from password protected Excel
    workbooks?

    Best regards,

    Geert-Pieter

    "John MacIntyre" <Please@reply.to.group.thx> schreef in bericht
    news:whR5b.20469$su.516344@news20.bellglobal.com...
    > If you know the password, you should be able to use it via the the MS

    Excel Object Model.
    >
    >
    > "Geert-Pieter Hof" <g.p.m.hof@wbmt.tudelft.nl.blablabla> wrote in message
    > news:bj7m4d$kp1$1@azure.qinip.net...
    > > Hello,
    > >
    > > My VB 6.0 application read and writes data from and to a MS Excel

    workbook,
    > > using the Microsoft.Jet.OLEDB.4.0 provider.
    > >
    > > Now I want to protect the Excel workbook with a password, but I figured

    out
    > > that it is not possible to open the workbook for data access with ADO
    > > (http://support.microsoft.com/?KBID=211378).
    > >
    > > Is there another way to use a password protected Excel workbook in my
    > > application?
    > >
    > > Regards,
    > >
    > > Geert-Pieter




  4. Default Re: Open password protected Excel workbook in Visual Basic

    "Geert-Pieter Hof" <g.p.m.hof@wbmt.tudelft.nl.blablabla> wrote in message
    news:bjkklf$j97$1@azure.qinip.net...
    > According to MS Knowledge Base Article 249843, the MS Excel Object library
    > is not redistributable. So I cannot the mentioned solution on computers

    that
    > haven't got MS Excel installed.
    >
    > So, is there another way to read data from password protected Excel
    > workbooks?
    >
    > Best regards,
    >
    > Geert-Pieter


    Hi Geert-Pieter,

    I assumed the user would have Excel.

    There is also a ODBC driver available. This has never really appealed to me
    since Excel does not have a rigid table structure, so I've always gone
    through the Object Model.

    Also, you better check the dependencies ... who knows if the user needs to
    have XL on their PC for the ODBC drivers to work.

    Do you mind if I ask why you are using an Excel file? I am assuming, from
    comments in this thread, the XL file is yours as part of your distributable.

    Regards,
    John MacIntyre
    VC++ / VB / ASP / Database Developer
    http://www.johnmacintyre.ca



  5. Default Re: Open password protected Excel workbook in Visual Basic

    > There is also a ODBC driver available. This has never really appealed to
    me
    > since Excel does not have a rigid table structure, so I've always gone
    > through the Object Model.


    Now I'm becoming a bit confused: MS Knowledge Base Article 211378 states
    that opening an password protected Excel workbook is not possible when using
    the MS Excel ODBC driver, so the above suggestion won't work.

    However, I am using the MS Jet OLE DB driver and I also can't open a
    password protected Excel workbook, although this problem isn't mentioned in
    MS Knowledge Base Article 211378. The MS Excel ODBC driver and the MS Jet
    OLE DB driver are two different drivers, don't you think?

    > Also, you better check the dependencies ... who knows if the user needs to
    > have XL on their PC for the ODBC drivers to work.
    >
    > Do you mind if I ask why you are using an Excel file? I am assuming, from
    > comments in this thread, the XL file is yours as part of your

    distributable.

    My application simulates some stuff and needs measured data that is spread
    over about 30 worksheets with about 2000 measurements pro worksheet. When
    some measurements change, new worksheets are supplied. So I don't want to
    convert the worksheets to a database tables each time some data changes.
    Furthermore, the people that are going to work with the software know to
    handle Excel workbooks, but hardly work with Acces databases.

    Best regards,

    Geert-Pieter



  6. Default Re: Open password protected Excel workbook in Visual Basic

    Maybe you are misreading the Excel licensing issue. If your users have Excel,
    then they have the complete object model, as fully licensed as the rest of their
    Excel. (You can develop and run an entire application in VBA for Excel in any
    standard installation).

    I don't think you can get around the password protection through any driver. It
    wouldn't be much of a password protection if you could.

    I think you should go ahead and go in through the object model. I have done it
    several times, never redistributed any part of Excel, and never had complaints
    that the program wouldn't run, as long as the user already had Excel installed.
    (Had other complaints, of course, but that is programming).

    "Geert-Pieter Hof" <g.p.m.hof@wbmt.tudelft.nl.blablabla> wrote in message
    news:bjmod4$b3c$1@azure.qinip.net...
    > > There is also a ODBC driver available. This has never really appealed to

    > me
    > > since Excel does not have a rigid table structure, so I've always gone
    > > through the Object Model.

    >
    > Now I'm becoming a bit confused: MS Knowledge Base Article 211378 states
    > that opening an password protected Excel workbook is not possible when using
    > the MS Excel ODBC driver, so the above suggestion won't work.
    >
    > However, I am using the MS Jet OLE DB driver and I also can't open a
    > password protected Excel workbook, although this problem isn't mentioned in
    > MS Knowledge Base Article 211378. The MS Excel ODBC driver and the MS Jet
    > OLE DB driver are two different drivers, don't you think?
    >


    > > Also, you better check the dependencies ... who knows if the user needs to
    > > have XL on their PC for the ODBC drivers to work.
    > >
    > > Do you mind if I ask why you are using an Excel file? I am assuming, from
    > > comments in this thread, the XL file is yours as part of your

    > distributable.
    >
    > My application simulates some stuff and needs measured data that is spread
    > over about 30 worksheets with about 2000 measurements pro worksheet. When
    > some measurements change, new worksheets are supplied. So I don't want to
    > convert the worksheets to a database tables each time some data changes.
    > Furthermore, the people that are going to work with the software know to
    > handle Excel workbooks, but hardly work with Acces databases.
    >
    > Best regards,
    >
    > Geert-Pieter
    >
    >




  7. Default Re: Open password protected Excel workbook in Visual Basic

    It's not a licensing issue, it's encryption. Password protecting an
    Excel workbook encrypts its contents on disk and ADO has no way of
    decrypting it.

    "Steve Gerrard" <notstevegerrard@comcast.net> wrote in message news:<1pudndzHZaWDdcKiXTWJkw@comcast.com>...
    > Maybe you are misreading the Excel licensing issue. If your users have Excel,
    > then they have the complete object model, as fully licensed as the rest of their
    > Excel. (You can develop and run an entire application in VBA for Excel in any
    > standard installation).
    >
    > I don't think you can get around the password protection through any driver. It
    > wouldn't be much of a password protection if you could.
    >
    > I think you should go ahead and go in through the object model. I have done it
    > several times, never redistributed any part of Excel, and never had complaints
    > that the program wouldn't run, as long as the user already had Excel installed.
    > (Had other complaints, of course, but that is programming).
    >
    > "Geert-Pieter Hof" <g.p.m.hof@wbmt.tudelft.nl.blablabla> wrote in message
    > news:bjmod4$b3c$1@azure.qinip.net...
    > > > There is also a ODBC driver available. This has never really appealed to

    > me
    > > > since Excel does not have a rigid table structure, so I've always gone
    > > > through the Object Model.

    > >
    > > Now I'm becoming a bit confused: MS Knowledge Base Article 211378 states
    > > that opening an password protected Excel workbook is not possible when using
    > > the MS Excel ODBC driver, so the above suggestion won't work.
    > >
    > > However, I am using the MS Jet OLE DB driver and I also can't open a
    > > password protected Excel workbook, although this problem isn't mentioned in
    > > MS Knowledge Base Article 211378. The MS Excel ODBC driver and the MS Jet
    > > OLE DB driver are two different drivers, don't you think?
    > >

    >
    > > > Also, you better check the dependencies ... who knows if the user needs to
    > > > have XL on their PC for the ODBC drivers to work.
    > > >
    > > > Do you mind if I ask why you are using an Excel file? I am assuming, from
    > > > comments in this thread, the XL file is yours as part of your

    > > distributable.
    > >
    > > My application simulates some stuff and needs measured data that is spread
    > > over about 30 worksheets with about 2000 measurements pro worksheet. When
    > > some measurements change, new worksheets are supplied. So I don't want to
    > > convert the worksheets to a database tables each time some data changes.
    > > Furthermore, the people that are going to work with the software know to
    > > handle Excel workbooks, but hardly work with Acces databases.
    > >
    > > Best regards,
    > >
    > > Geert-Pieter
    > >
    > >


+ Reply to Thread

Similar Threads

  1. Open a specific Excel Workbook
    By Application Development in forum ADO DAO RDO RDS
    Replies: 3
    Last Post: 12-01-2007, 03:07 PM
  2. identify open workbook in excel?
    By Application Development in forum RUBY
    Replies: 1
    Last Post: 11-12-2007, 05:37 PM
  3. Open Password protected Excel from Access
    By Application Development in forum ADO DAO RDO RDS
    Replies: 5
    Last Post: 09-13-2007, 10:28 PM
  4. Open Excel workbook code example
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 05-10-2006, 06:35 AM
  5. How to open a password protected .Pst file using VC++
    By Application Development in forum Microsoft Exchange
    Replies: 1
    Last Post: 08-05-2005, 04:01 AM