Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Device I/O Error
After stepping thru my code I'm getting the aboce message.
What does this usually mean? Any hints would be helpful. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Device I/O Error
I have this code in my Userform code window (if that helps).
Private Sub CommandButton1_Click() Unload Me ThisWorkbook.Close savechanges:=False End Sub "JMay" wrote: After stepping thru my code I'm getting the aboce message. What does this usually mean? Any hints would be helpful. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Device I/O Error
Generally, "Device I/O Error" is hardware related. You might give strong
consideration to making sure you have a good backup strategy in place for whatever drive you are using to save those files on. BTW: You shouldn't even need the "Unload Me" statement in your sub ... it's going to be unloaded when the ThisWorkbook.Close statement executes. The Unload Me may even be confusing things (haven't tested it) because Unload means to take it out of memory, which would, in theory at least, remove the code in it also. "JMay" wrote: After stepping thru my code I'm getting the aboce message. What does this usually mean? Any hints would be helpful. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Device I/O Error
Thanks JLatham;
Your logic makes total sense. I removed the Unload me (line) and things seem to be working better. Jim "JLatham" wrote: Generally, "Device I/O Error" is hardware related. You might give strong consideration to making sure you have a good backup strategy in place for whatever drive you are using to save those files on. BTW: You shouldn't even need the "Unload Me" statement in your sub ... it's going to be unloaded when the ThisWorkbook.Close statement executes. The Unload Me may even be confusing things (haven't tested it) because Unload means to take it out of memory, which would, in theory at least, remove the code in it also. "JMay" wrote: After stepping thru my code I'm getting the aboce message. What does this usually mean? Any hints would be helpful. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Device I/O Error
Interesting that it continues to work without error. I opened a new
workbook, set up a userform with a command button and put the 2 statements in it, as you originally had them. Saved it all "just in case" (a good thing). When I clicked the button I got an Excel (2003) has stopped running error. Took out the Unload Me statement and I still got the same error with just the ThisWorkbook.Close False statement in it. Might be a better thing if you set a global flag in the routine to test on return and do the close in a regular code module if you experience any problems later on with this piece. Code might look something like this: Private Sub CommandButton1_Click() globalCloseWorkbookFlag = True Unload Me End Sub then back in your code that called the UserForm, it might look something like this up in a declaration section of a module you'd have Public globalCloseWorkbookFlag as Boolean then down in the code that calls the UserForm: .... other code ahead of this section globalCloseWorkbookFlag = False UserForm1.Show If globalCloseWorkbookFlag Then ThisWorkbook.Close False Exit Sub End if .... more code for when the workbook is not to be closed Sub "JMay" wrote: Thanks JLatham; Your logic makes total sense. I removed the Unload me (line) and things seem to be working better. Jim "JLatham" wrote: Generally, "Device I/O Error" is hardware related. You might give strong consideration to making sure you have a good backup strategy in place for whatever drive you are using to save those files on. BTW: You shouldn't even need the "Unload Me" statement in your sub ... it's going to be unloaded when the ThisWorkbook.Close statement executes. The Unload Me may even be confusing things (haven't tested it) because Unload means to take it out of memory, which would, in theory at least, remove the code in it also. "JMay" wrote: After stepping thru my code I'm getting the aboce message. What does this usually mean? Any hints would be helpful. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
text pc device | Excel Discussion (Misc queries) | |||
How do you export excel data to a PDA, Palm device ? | Excel Discussion (Misc queries) | |||
Beam a file to a device. | Excel Worksheet Functions | |||
Excel - Human Interface Device How To | Excel Discussion (Misc queries) | |||
Device I/O Error | Excel Discussion (Misc queries) |