

ThisWorkbook.Sheets(PasteDestination).Pasteįunction Is_Pic_in_Clipboard() As Boolean ThisWorkbook.Sheets(CopyDestination).Shapes(ItemName).Copy

Public Sub CopyShape(ItemName As String, ByRef CopyDestination As Worksheet, ByRef PasteDestination As Worksheet) IsClipboardEmpty = (CountClipboardFormats() = 0) If (lFormat = 2 Or lFormat = 3 Or lFormat = 9 Or lFormat = 14 Or lFormat = 25 Or lFormat = 29) Then IsPicOnClipboard = True: Exit Do ' If InStr(1, Trim(lFormat), "14", vbTextCompare) > 0 Then IsPicOnClipboard = True: Exit Do ' If sName Like "*PowerPoint 12.0 Internal Shapes*" Then IsPicOnClipboard = True: Exit Do ' GetClipboardFormatName lFormat, sName, Len(sName) Public Function IsPicOnClipboard() As Boolean
#Excel macro to copy and paste from one worksheet to another windows
' Check if PowerPoint shape object is on the Windows clipboard IsClipboardFormatAvailable(29) 0 Then IsPicInClipboard = True IsShapeOnClipboard = IsClipboardFormatAvailable(&HC216&) If OpenClipboard(0&) = 0 Then Exit Function ' Could not open clipboard ' Wait until PowerPoint shape object is on the Windows clipboard Left = WK2.Cells(i + j, 3).MergeArea.Left + WK2.Cells(i, 3).MergeArea.Width - Shp2.Widthĭeclare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)ĭeclare PtrSafe Function OpenClipboard Lib "user32" (ByVal hwnd As LongPtr) As Longĭeclare PtrSafe Function CloseClipboard Lib "user32" () As Longĭeclare PtrSafe Function EnumClipboardFormats Lib "user32" (ByVal wFormat As Long) As Longĭeclare PtrSafe Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As LongPtrĭeclare PtrSafe Function GetClipboardFormatName Lib "user32" Alias "GetClipboardFormatNameA" (ByVal wFormat As Long, ByVal lpString As String, ByVal nMaxCount As Long) As Longĭeclare PtrSafe Function Empt圜lipboard Lib "user32" () As Longĭeclare PtrSafe Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Long) As Longĭeclare PtrSafe Function CountClipboardFormats Lib "user32" () As Longĭeclare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)ĭeclare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Longĭeclare Function CloseClipboard Lib "user32" () As Longĭeclare Function EnumClipboardFormats Lib "user32" (ByVal wFormat As Long) As Longĭeclare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Longĭeclare Function GetClipboardFormatName Lib "user32" Alias "GetClipboardFormatNameA" (ByVal wFormat As Long, ByVal lpString As String, ByVal nMaxCount As Long) As Longĭeclare Function Empt圜lipboard Lib "user32" () As Longĭeclare Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Long) As Longĭeclare Function CountClipboardFormats Lib "user32" () As Long Left = WK2.Cells(i + j, 3).MergeArea.Left WK2.Paste Destination:=WK2.Cells(i + j, 3) ', link:=False

Dim Shp1 As Shape, Shp2 As Shape, Shp3 As Shape, Shp4 As Shape, i&, j&
