Import not working

Locopete99

Registered User.
Local time
Yesterday, 22:22
Joined
Jul 11, 2016
Messages
163
Hi Guys,

Can someone help please.

I have an import command thats not working. The table is a linked table in my back end but that has never mattered in the past.

Code:
DoCmd.TransferSpreadsheet acImport, , "Tbl_debt", "R:\In box management project\Import.xlsx", yes, "exportrange"
 
Not working? What error what happens?

I don't think you can import to a linked table, transfer spreadsheet will overwrite the existing table?
 
Why are you using "yes" and not True/False/1/0???

https://docs.microsoft.com/en-us/office/vba/api/access.docmd.transferspreadsheet


Hi Guys,

Can someone help please.

I have an import command thats not working. The table is a linked table in my back end but that has never mattered in the past.

Code:
DoCmd.TransferSpreadsheet acImport, , "Tbl_debt", "R:\In box management project\Import.xlsx", yes, "exportrange"
 
No idea why Gasman, but that solved it. Working fine now.
 
You didn't tell us what error you got, but you must not have Option Explicit in your code because otherwise, it should have barfed over the "Yes" used syntactcally as a variable. Now, "vbYes" IS a perfectly valid constant but it doesn't mean "TRUE" and therefore might not have been effective there either.
 
It didn't give me an error Doc, it looked like it ran but then when i checked it hadn't. Kinda how it looks when you try to run an incomplete If, if you get my meaning.
 

Users who are viewing this thread

Back
Top Bottom