Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3011 - could not find file 1

Status
Not open for further replies.

trudye10

Programmer
Sep 8, 2006
67
I am receiving error '3011' could not find object. Here is my code.

Code:
<html>
  <head>
    <title>Page</title>
  </head>
  <body>
Function Export_Output()

On Error GoTo WhyMe
DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel9, "tblEnroll_Error_Report", "U:\marketing\ResultsControl\AON_Enroll_Error_Report-2_" & Format(Date, "yyyymmdd") & ".xls", True
Exit Function
WhyMe:
    MsgBox ("Error Number: " & Err.Number & " | Error Description: " & Err.Description)

End Function
 </body>
</html>

I've used this command before and never had a problem, what am I missing?

Thanx,
Trudye
 
"U:\marketing\ResultsControl\AON_Enroll_Error_Report-2_" & Format(Date, "yyyymmdd") & ".xls"

Are you sure the drive mapping is still the same? I'm guessing that the U drive may be pointing to a network location.

One way to get around that type of problem would be to use the full network path as apposed to the drive letter associated with it (if this is indeed the case).

--

"If to err is human, then I must be some kind of human!" -Me
 
By George I think I've got it. I forgot the acExport behind the transfertext command

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblEnroll_Error_Report", "E:\marketing\ResultsControl\AON_Enroll_Error_Report-2_" & Format(Date, "yyyymmdd") & ".xls", True


So he was trying to do an import and thus could not find the file!!!

Thanx to everyone who chimmed in!
Trudye
 
Anytime! All of us are here trying to help! [wink]

[rofl]

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top