I am trying to use Access (both 2003 and 2007) in conjunction with an excel file. The plan is to send certain numerical data to excel, let excel make calcs based on the data, then bringing the data back into Access for reports and further calcs that are convenient to do in Access. I open the worksheet with:
Set oWB = oXL.Workbooks.Open("\Path\ExcelFileName", , False
oSheet = oWB.Sheets("SpinSadder") ' I added the False after reading someone else’s post.
After updating certain cells, I import back with:
oXL.Quit
Set oRng = Nothing
Set oSheet = Nothing
Set oWB = Nothing
Set oXL = Nothing
DoCmd.TransferSpreadsheet acImport, 8, "ImportTableName",” Path", True, "WorksheetName!Range"
Several worksheets are possible depending on which Access Form is being used.
Sometimes, when I have both computers working with the excel file, I will get messages that the excel file is already open etc. Other indicators, (menu bar and task manager) don’t show it open. If I open it myself, it will claim to be read only or indicate that a copy is already open. This doesn’t happen every time, just enough to drive me crazy. Is what I am trying to do possible? Any help much appreciated.