Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to switch backgrounds as an indication to the user
of unsaved changes. I want it to skip it if it is going to cause a run time error so I use "on error resume next", but it still errors when there is not enough memory. How do I make it really skip the setbackgroundpicture function if there is not enough memory? On Error Resume Next ThisWorkbook.Worksheets("Data").SetBackgroundPictu re ThisWorkbook.Path & _ Application.PathSeparator & "QPIBackground.jpg" TIA Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.MemoryFree returns the number of bytes available to Excel to use.
You need to determine how many bytes are required for your operation and compare this to what is available and the abandon or execute your operation. "Mike Archer" wrote: I want to switch backgrounds as an indication to the user of unsaved changes. I want it to skip it if it is going to cause a run time error so I use "on error resume next", but it still errors when there is not enough memory. How do I make it really skip the setbackgroundpicture function if there is not enough memory? On Error Resume Next ThisWorkbook.Worksheets("Data").SetBackgroundPictu re ThisWorkbook.Path & _ Application.PathSeparator & "QPIBackground.jpg" TIA Mike |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That sounds good. How do I determine how many bytes are
required for the operation? Mike -----Original Message----- Application.MemoryFree returns the number of bytes available to Excel to use. You need to determine how many bytes are required for your operation and compare this to what is available and the abandon or execute your operation. "Mike Archer" wrote: I want to switch backgrounds as an indication to the user of unsaved changes. I want it to skip it if it is going to cause a run time error so I use "on error resume next", but it still errors when there is not enough memory. How do I make it really skip the setbackgroundpicture function if there is not enough memory? On Error Resume Next ThisWorkbook.Worksheets("Data").SetBackgroundPictu re ThisWorkbook.Path & _ Application.PathSeparator & "QPIBackground.jpg" TIA Mike . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure I know the answer or how it coould be determined. I would guess
as follows: When the operation fails, Ctrl + Break and then query available memory. Now you know how much is NOT enough. Let this be A. I would add something to this, say 8K, and assume that the operation is not possible unless A bytes + 8K is available. You'll need to fine tune this with trial and error. "Mike Archer" wrote: That sounds good. How do I determine how many bytes are required for the operation? Mike -----Original Message----- Application.MemoryFree returns the number of bytes available to Excel to use. You need to determine how many bytes are required for your operation and compare this to what is available and the abandon or execute your operation. "Mike Archer" wrote: I want to switch backgrounds as an indication to the user of unsaved changes. I want it to skip it if it is going to cause a run time error so I use "on error resume next", but it still errors when there is not enough memory. How do I make it really skip the setbackgroundpicture function if there is not enough memory? On Error Resume Next ThisWorkbook.Worksheets("Data").SetBackgroundPictu re ThisWorkbook.Path & _ Application.PathSeparator & "QPIBackground.jpg" TIA Mike . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error Resume Next problem | Excel Discussion (Misc queries) | |||
On Error Resume Next | Excel Programming | |||
ON ERROR RESUME NEXT | Excel Programming | |||
On Error Resume Next | Excel Programming | |||
On Error Resume Next | Excel Programming |