Import not working (1 Viewer)

Locopete99

Registered User.
Local time
Today, 03:59
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"
 

Minty

AWF VIP
Local time
Today, 11:59
Joined
Jul 26, 2013
Messages
10,368
Not working? What error what happens?

I don't think you can import to a linked table, transfer spreadsheet will overwrite the existing table?
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:59
Joined
Sep 21, 2011
Messages
14,234
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"
 

Locopete99

Registered User.
Local time
Today, 03:59
Joined
Jul 11, 2016
Messages
163
No idea why Gasman, but that solved it. Working fine now.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:59
Joined
Feb 28, 2001
Messages
27,140
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.
 

Locopete99

Registered User.
Local time
Today, 03:59
Joined
Jul 11, 2016
Messages
163
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

Top Bottom