Elana
Registered User.
- Local time
- Today, 04:41
- Joined
- Apr 19, 2000
- Messages
- 232
Hi -
I've been trying to figure this out for two days and have gotten close, but now I'm stuck:
I need to open several excel workbooks, then calculate, save and close them. I want to do this from Access and here is what I've developed so far (using only one workbook as an example):
Public Function SaveCalcExcel()
Dim objxls As Object
Set objxls = CreateObject("Excel.application")
objxls.Workbooks.Open FileName:="C:\skiapplicationdata\resortinfo1.xls"
objxls.Visible = True
objxls.calculate
objxls.Workbooks.Close
objxls.Quit
Set objxls = Nothing
End Function
This seems to run all right, but it's not calculating the workbook. I added a line "objxls.save", but that doesn't seem to work as it get a message saying "Resume.xlw already exists...Replace?".
Anyway, I know I'm close, but I don't know what I'm missing here. Please help if you can set me straight. Thanks much!
E
I've been trying to figure this out for two days and have gotten close, but now I'm stuck:
I need to open several excel workbooks, then calculate, save and close them. I want to do this from Access and here is what I've developed so far (using only one workbook as an example):
Public Function SaveCalcExcel()
Dim objxls As Object
Set objxls = CreateObject("Excel.application")
objxls.Workbooks.Open FileName:="C:\skiapplicationdata\resortinfo1.xls"
objxls.Visible = True
objxls.calculate
objxls.Workbooks.Close
objxls.Quit
Set objxls = Nothing
End Function
This seems to run all right, but it's not calculating the workbook. I added a line "objxls.save", but that doesn't seem to work as it get a message saying "Resume.xlw already exists...Replace?".
Anyway, I know I'm close, but I don't know what I'm missing here. Please help if you can set me straight. Thanks much!
E