Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recover backround file when code errors out

Status
Not open for further replies.

VicM

Programmer
Sep 24, 2001
442
0
16
US
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
 
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 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,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
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.
 
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
 
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, [tt]objExcel.Visible = True[/tt] or whatever you call your Excel object in the code.



---- Andy

There is a great need for a sarcasm font.
 
You realize that while in Debug, you can execute code in the Immediate Window, like
[tt]Excel.Visible = True[/tt]

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top