Error Importing Data From Excel (1 Viewer)

Eljefegeneo

Still trying to learn
Local time
Today, 14:12
Joined
Jan 10, 2011
Messages
904
At times when I try to import data from Excel I get the error message” “Microsoft unable to append all the data to the table” or something like that.

I am trying to figure out what error code this is if any and how do I trap it so I can advise the user to contact me. I know that there are error handlers that say if error code is such and such then you can have a “goto” line of code and there can be the message box. But I can’t seem to find the code for this error message if there is one at all.
 

Eljefegeneo

Still trying to learn
Local time
Today, 14:12
Joined
Jan 10, 2011
Messages
904
Thanks, but I know why this is happening. I wanted to know is there is an error code so I could use error handling so that I could use a message box pop up to warn the user that the import didn't work and to contact their supervisor. The warning that Microsoft uses is fine, but users are confused by this. If no error code exists, is there a way to go around this to have a message box pop up with my message?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:12
Joined
Feb 28, 2001
Messages
27,001
You SHOULD be able to have an error handler to trap the error and put a breakpoint there. Then used Debug.Print Err.Number (and also Err.Description) to see the detailed error number and text.

Let's put it this way... EITHER you just crashed the process, in which case there will be no viable error handling but should be something in the system event logs, OR you can use the trap to identify the error number and text. The odds GREATLY favor that it is the "key violation" situation described in the article I posted.

But then again, there is this question: Is the import being done by a macro? Macro error handling is anywhere from "not very good" to "total trash." If this were VBA code, the trap would work better. Just have to have errors enabled and let the error happen.
 

Users who are viewing this thread

Top Bottom