Updating Excel using ADO via VBScript RRS feed

  • Question

  • This is driving me nuts.  Does anyone know how to use ADO to update an Excel spreadsheet via VBScript?

    I've tried pretty much every approach that I could image with no success.  I'd like to use "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    ' "Data Source=" & Datasrc & ";" & _
    ' "Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;"""


    But I can't get it to work.


    I'd like to be able to update a single cell and I'd also like to be able to add a new record.


    At this point I've tried so many variations of things using the direct connection and I've tried using a recordset.  But no luck with either.  The only way I actually got this to work was by creating a Defined name and setting up a DSN (but I don't want to have to settle for this method it's old and clunky and I don't want to have to set this up on every computer).


    Any help will be greatly appreciated.


    Best regards,



    Wednesday, December 5, 2007 9:58 AM

All replies

  • It might help us to know exactly where you are getting hung up. Are you getting any errors? Where in the code does the error occur?


    Wednesday, December 5, 2007 12:52 PM
  • Sorry, but I don't know where I'm getting hung up.  It's not working so I can't say what the problem is.  At this point I'm not sure I'm even in the right ball park.  I'm wondering if Excel access via ADO might just have some serious limitations.


    Does anyone know how to do this or have some code that they've had success with?


    I'll try to reconstruct my code and send that in my next thread.  It's just that I've tried so many variations I'm not sure what to use and what not to use.



    Wednesday, December 5, 2007 10:11 PM
  • I finally figured it out.  I'm all set thanks.


    Friday, December 7, 2007 2:16 AM