- Local time
- Today, 14:26
- Joined
- Aug 30, 2003
- Messages
- 36,127
Okay, I've stumped myself. I'm creating an automated routine to grab an attached Excel file out of an email and process it. I've done several successfully. The process up to saving the attachment is fine:
outAttachment.SaveAsFile sFile
If I go to Windows Explorer I can open the file. If I let the import routine run, it throws a runtime error 1004. The failing line is the third (using late binding):
Set xl = CreateObject("excel.application")
strFile = "C:\AccessAp\TravelDayTransactions.xlsx"
xl.Workbooks.Open (strFile)
If I then go back into Explorer, I can't open the file anymore, leading me to believe the automation corrupts the file. Anybody spot the bonehead error I must have made?
outAttachment.SaveAsFile sFile
If I go to Windows Explorer I can open the file. If I let the import routine run, it throws a runtime error 1004. The failing line is the third (using late binding):
Set xl = CreateObject("excel.application")
strFile = "C:\AccessAp\TravelDayTransactions.xlsx"
xl.Workbooks.Open (strFile)
If I then go back into Explorer, I can't open the file anymore, leading me to believe the automation corrupts the file. Anybody spot the bonehead error I must have made?