×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Recover backround file when code errors out

Recover backround file when code errors out

Recover backround file when code errors out

(OP)
Hi,

I have a procedure in Access that imports data from an Excel file after coded manipulation of that data. This is done in the background; that is, the Excel app doesn't appear on the taskbar. When the code errors out and I have to stop the execution, the Excel app is still showing as a process in the task manager.
What I'd like to know, is there a way for me to bring the Excel application into view? It would be really helpful to see what transpired in the spreadsheet that caused the error. I've tried much error trapping, but have been unsuccessful in trapping this occurrence. At this point my only option is to kill the process and thereby lose the info in the spreadsheet.
Basically the error message is saying there is a type conversion error. But when I look at the line of data in the spreadsheet that it's referencing, I don't see an incorrect data type. And that particular value has been processed in a data record above the indicated line of error without itself throwing an error.

Thanks for any suggestions,
Vic

RE: Recover backround file when code errors out

Hi,

Is your question about something happening in Access or something happening in Excel?

Your question leads me to believe the latter. If so, maybe this is a forum707: VBA Visual Basic for Applications (Microsoft) question.

Need to see code involved.
Need more solid info regarding the state of things in Excel. What happens when you Debug and snoop around in Excel. Can you Save the workbook in Debug?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Recover backround file when code errors out

"Need to see code involved." including the error handler (you have one, right?)
That's where you would make Excel visible when your error happens.


---- Andy

There is a great need for a sarcasm font.

RE: Recover backround file when code errors out

(OP)
Skip,

You're right. I should have posted it in VBA for Applications. Actually that's where I had posted questions in the past.
Thanks for the wake up call.

Vic

RE: Recover backround file when code errors out

Quote:

Access that imports data from an Excel file [and] This is done in the background; that is, the Excel app doesn't appear on the taskbar.

If you can recreate the error, why not show the Excel while doing it? Make Excel visible from the start, so “When the code errors out and I have to stop the execution”, you can SEE what’s going on.

“is there a way for me to bring the Excel application into view?” Yes, objExcel.Visible = True or whatever you call your Excel object in the code.


---- Andy

There is a great need for a sarcasm font.

RE: Recover backround file when code errors out

You realize that while in Debug, you can execute code in the Immediate Window, like
Excel.Visible = True

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Recover backround file when code errors out

I know that, do it all the time.
I just don't know if VicM knows that... ponder Hard to determine his/her knowledge about VBA / error handling / debugging / etc. Plus now we have this conversation in two places.


---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close