Runtime error '3349'

jk12

Always getting problems.
Local time
Today, 18:19
Joined
Feb 16, 2006
Messages
91
Hi all,

I've spent a while now trying to find an answer to my problem but so far no luck.

I have a database which once a month someone clicks a button to pull info in from an excel document. My problem is if the excel document is on our server and the vba path points to it there I get the runtime error 3349, however if I copy the exact a same file to my desktop and simply change the vba path location, I get no error and all data copies in fine.

Anybody know why I get the error only when copying info from the excel file when it is on our server?

Thanks
 
Are you using the server name in your path

\\Server Name etc
 
Yes, path is as below

\\b-srv1\Company\CSMR\CSMR.xls
 
Can you share with us the code that's causing this error?
 
No probelm, code being used is as below.

Private Sub Command2_Click()

CurrentDb.Execute "Delete * From CSMR;"

'DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="CSMR", FileName:="\\B-srv1\Company\CSMR\CSMR.xls", HasFieldNames:=True

MsgBox "Update completed"

End Sub
 
You have a comment at the beginning of the DoCmd so this wont work,

Remove the comment ' Symbol
 
That comment is my typing mistake and not meant to be shown. The code still doesn't work even if there is no comment.

As I say, the same code but with the path set to my C drive works fine but as soon as I change it to a server path it stops working.
 
Do a test -

Can you import the spreadsheet from the network share location MANUALLY? Does it work?
 
A manual import works fine. By manual I've assumed you mean open excel, copy the records, then aste them into the access table.
 
A manual import works fine. By manual I've assumed you mean open excel, copy the records, then aste them into the access table.

No, I'm not talking about copy/paste. I am talking about going to the EXTERNAL DATA tab (if using 2007 or above) or the FILE > GET EXTERNAL DATA IMPORT (if using 2003 or lower) and then following the wizard.
 
After looking at the problem a bit more, I can import data from the excel document (both through vba and get external data method) regardless of the excel document being on my desktop or on the server so long as I'm importing it to a local table. However, if I try and import to a linked table I then get the error.

The local table is a straight copy of the Backend table into my frontend so everything is the same except its now local to my frontend not a linked table to the backend.

Hopefully this may help provide an answer.
 

Users who are viewing this thread

Back
Top Bottom