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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Screensaver Lock Disrupts Scheduled Code

Status
Not open for further replies.

BenSC

Technical User
Jul 24, 2001
43
GB
Dear All,
I have a number of scheduled tasks that run an Access module which:

* Runs and exports a crystal report as an Excel file
* Loads the exported file in Excel and applies standard formatting (bold font, size etc)
* Saves and closes the Excel sheet

This code runs perfectly, except when my PC is locked, which happens after 20 minutes of inactivity due to corporate Registry setup.

When the PC is locked the report is run\exported fine and loads in Excel. However, as soon as the report is loaded in Excel the error message "Not enough system resources to display completely" is output, which causes the code to hang. The sheets I'm working with don't have a large amount of data and run perfectly when the PC isn't locked.

If anyone could help me with any suggestions I'd be very grateful.

Thanks in anticipation
Ben Cooper
 
you can hack the registry to change the timeout as part of your macro, this will be reset at next logon of course.
you could even read the original setting and put it back at the end of the macro so not to offend anyone...well that is unless they have locked it down so that you can mod these keys..
 
mrmovie,
I've manually hacked the registry to disable the Locking of windows in order to get around my problem. Registry hacking is however, strictly against corporate policy, so ideally I'm looking for a solution that will enable the schedule to run on a locked PC, or code so I can unlock the PC automatically using the schedule.

Thanks for the suggestion though, it's much apreciated.

Ben Cooper
 
What happens when you create excel application object initially and use it ready later, when the report is finished?
What excel version you use, what type of formatting and how? Esp. excel 97 was very memory consuming and slow when you format printing options (page setup, headers, footers etc).
Direct access to objects (for instance Range("A1").Font.Bold=True) could help if you used syntax from recording (Range("A1").Select:Selection.Font.Bold=True).

combo
 
Combo,
If I open Excel prior to running the schedule the result is still the same.
I'm using Access\Excel XP and have sufficient memory resources to run far larger reports than this when my PC is unlocked. My hunch is that Windows somehow reduces the memory allocation when the PC is locked, but I've not been able to find anybody who can confirm this.

Regards
Ben Cooper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top