Update access table rst with named cell values from excel
        Posted  
        
            by uZI
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by uZI
        
        
        
        Published on 2010-03-19T17:45:20Z
        Indexed on 
            2010/03/28
            14:53 UTC
        
        
        Read the original article
        Hit count: 296
        
I have got a table in access that I loop through using a DAO recordset. For every recordset I take a bunch of data to an excel spreadsheet and run it through a model in excel. This produces a bunch of results in excel which are calculated in named cells.
I want to be able to update the current recordset in access with these results but am having a tough time doing it.
I have the following code
code to create a DAO recordset
code to move to first record
code to parse data to excel
code to run a bunch of stuff in excel including a goal seek to calculate results
next I use the follwoing code without success
            With MyXL
            strSQL = "UPDATE ProductPricing SET Profit = " & .Names("Profit") & ";"
            End With
Code to move to next record and loop until EOF
any help is appreciated
thanks
© Stack Overflow or respective owner