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!

short delay after opening excel workbook

Status
Not open for further replies.

fishysheep

Programmer
Oct 13, 2001
54
GB
Hi

working with excel wb that had become very bloated over time. Code in wb.open to clear all sheets (formatting, formulae and data), drawing objects, names, shapes and links. That's worked to reduce file size (20% of original) but once the code has finished running I can't click on a sheet - there is a delay of about 5 seconds. During this delay the cursor doesn't change, but if I repeatedly click the sheet then I title bar of excel shows flashes "not responding" and then all is well. It's not the code itself because if I add it to a new wb, works as expected and there is no delay - sheet can be clicked straight away.

I'm assuming that despite having deleted formatting, data, formulae, objects, shapes, namedranges and links there is still something else lurking. Any ideas?


no protection on sheet and excel startxl is empty.
 
got it! 5mb down to 122k :)

turned out I had 817 oleObjects. Not enough just to check for links or drawingobjects, also have to check type of drawing object:


For Each obj In sheet.DrawingObjects
if typename(obj) ="OLEObject" then obj.delete
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top