Question Excel Import does not work (1 Viewer)

Leigh46137

Registered User.
Local time
Today, 00:36
Joined
Dec 29, 2009
Messages
12
Strangest problem I've ever seen in Access!

I have an Access 2007 database that needs to import from an Excel file. My code just runs a stored import procedure. When that didn't appear to be working, I tried it manually.

I clicked External Data, Import Excel. Browsed to my spreadsheet and selected to append records to the GroupImport table. The next screen showed my data with the proper column headings matching the field names of the table. (It has only 5 records at the moment for testing, and all are displayed.) I clicked through to fininsh and close. It came back with a message that all objects were imported successfully. I open the GroupImport table and there are NO records.

I don't get any error messages. Everything appears to work correctly, but it doesn't import anything.

Anyone have any suggestions for this?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:36
Joined
Sep 12, 2006
Messages
15,614
a) what happens if you import to a new table?

b) maybe you have warnings turned off
if you turn them off in code, and dont turn them back on in code, they stay turned off!


sub warningson
docmd.setwarnings true
end sub

save this in a module, and run it there. its easy for this to happen, if your code errors inside a block with warnings off, and yuo dont have a error handler to turn them back on.

same thing happens with the hourglass also.
 

SOS

Registered Lunatic
Local time
Yesterday, 21:36
Joined
Aug 27, 2008
Messages
3,517
a) what happens if you import to a new table?

b) maybe you have warnings turned off
if you turn them off in code, and dont turn them back on in code, they stay turned off!


sub warningson
docmd.setwarnings true
end sub

save this in a module, and run it there. its easy for this to happen, if your code errors inside a block with warnings off, and yuo dont have a error handler to turn them back on.

same thing happens with the hourglass also.
Of course you can just type

DoCmd.SetWarnings True

in the IMMEDIATE WINDOW and hit enter and that takes care of it. And for the hourglass a simple:

Screen.Mousepointer = 1

in the Immediate Window will take care of it.
 

Leigh46137

Registered User.
Local time
Today, 00:36
Joined
Dec 29, 2009
Messages
12
I don't think the warnings are turned off. I know I don't have any code that turns them off. I'll run that warningson code just to make sure.

I have not tried importing to a new table. I will try that and see what happens to help determine what the problem is. The database is on a machine at another site though, so I may not be able to get there until the middle of the week. (The importing works fine on my copy of the database on my machine).

Thanks!
 

SOS

Registered Lunatic
Local time
Yesterday, 21:36
Joined
Aug 27, 2008
Messages
3,517
I don't think the warnings are turned off. I know I don't have any code that turns them off. I'll run that warningson code just to make sure.

I have not tried importing to a new table. I will try that and see what happens to help determine what the problem is. The database is on a machine at another site though, so I may not be able to get there until the middle of the week. (The importing works fine on my copy of the database on my machine).

Thanks!

Then make sure that the database location is set as a trusted location on the computer that it doesn't work on.
 

Leigh46137

Registered User.
Local time
Today, 00:36
Joined
Dec 29, 2009
Messages
12
OH! The trusted location thing might be the problem. When I open the database it gives me the message that it isn't trusted and I select the option to allow the blocked content. Do you think it is still blocking this operation even though I said to allow the content?

I did try setting it as a trusted location when I first installed it, but it wouldn't let me. I think it said I didn't have sufficient security rights. If you think it might still be blocking the import even though I chose to allow it, then I will see about getting someone with full rights to set it as a trusted location.
 

SOS

Registered Lunatic
Local time
Yesterday, 21:36
Joined
Aug 27, 2008
Messages
3,517
Well, it SHOULDN'T block you if you clicked that enable button.

Perhaps the user doesn't have sufficient rights (read/write/delete) on the location of the backend database and so it can't write to the table.
 

Leigh46137

Registered User.
Local time
Today, 00:36
Joined
Dec 29, 2009
Messages
12
I wish I knew what caused this to happen. It was working fine on my machine until after the client had problems. Then it started doing the same on mine. I have changed my saved import to import as a "new" table (overwriting the existing one each time) and that works fine.
 

Users who are viewing this thread

Top Bottom