tags:

views:

32

answers:

0

hi experts. i have one macro,which i called when cell change. this macro select images and delete them and insert another image depending on cell value using following code. i have same code for two sheets.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    ActiveSheet.Shapes.SelectAll
      Selection.Delete

'insert image code here. End Sub

in one sheet its working perfectly fine and delete all images while in other sheet , it give me runtime error "out of memory" and highlight following line.

 ActiveSheet.Shapes.SelectAll

can any one tell me why this is happening? it works perfectly fine in one and not in other.

one other thing i want to tell you is. it was working fine when i gave this macro excel to my client,both sheets were working fine, suddenly after 2 days, he started getting error on one sheet on which he was working lot.

dont know why this is happening. can anyone tell me whats reason and how to solved it?