This time is: "To select a shape its view must be active". It worked 2 times by selecting slide again right before the Select All method, then I changed something small (a cell than refers to numslide) and it is not working again.Idle time is often wasted time, however, sometimes you just need to wait for certain events to happen before you can continue code execution.VBA extends a couple of approaches to managing your idle time – the most popular approach is the Sleep procedure.As I will try to prove – there are better, more productive approaches to pausing your code execution or utilizing potentially application idle time. Wait function is similarly pretty easy to use, although a little different than what you might expect with the Sleep function. Wait will This approach is of course less practical as usually you want to wait simply for a precise interval of time, like say 3 seconds.Let us start by introducing the VBA Sleep function. Wait is a native VBA function that pauses code execution until a certain time is reached. Wait function is: The time when the function should return e.g. That is why we need to aid ourselves with the use of either the Date Add function or the Time Value function: What does the function above do? Goto Slide pp Slide.slidenumber On Error Go To -1: On Error Go To 0 Do Events If Paste Range Then If Paste_Type = xl_Bitmap Then '//Paste Range as Picture Paste Object.
I want to start off this post by thanking everyone who sent in their examples in response to my January request.The procedure pauses code execution for a certain amount of time putting the whole processes in a type of coma.It is one of the most popular approaches to pausing code execution, and at the same time simplest one.kb_id=370 ' Modified by : Krishnakumar @ Excel ' Used Late binding so that no issues when users have multiple Excel version Dim Paste Range As Boolean Dim obj Chart As Chart Object Dim lng SU As Long Select Case Type Name(Paste Object) Case "Range" If Not Type Name(Selection) = "Range" Then Application. Cells(1) Paste Range = True Case "Chart": Set obj Chart = Paste Object. Parent Case "Chart Object": Set obj Chart = Paste Object Case Else Msg Box Paste Object. Macro will exit", vb Critical Exit Sub End Select With Application lng SU = .