I have a macro in Excel that creates a Word object, then creates and executes a macro in Word. The Word macro simply pastes the contents of the clipboard (that was copied as part of the Excel macro) as a wdPasteMetafilePicture.
All is well until this is executed on laptops. It seems that wdPasteMetafilePicture is not available on the laptops.
Why wouldn't this be available to the laptop? This seems like a basic operation. Is there a format that I can use for both desktop and laptop systems?
All is well until this is executed on laptops. It seems that wdPasteMetafilePicture is not available on the laptops.
Code:
Dim app As Object
Dim doc As Object
Dim module As Object
Dim strCode As String
Set app = CreateObject("Word.Application")
app.Visible = True
Set doc = app.Documents.Add
Set module = doc.VBProject.VBComponents.Add(1)
strCode = "Sub EFTMacro()" & vbCr & _
"Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, _" & vbCr & _
"Placement:=wdFloatOverText, DisplayAsIcon:=False" & vbCr & _
"End Sub"
module.CodeModule.AddFromString strCode
app.Run "EFTMacro"
Why wouldn't this be available to the laptop? This seems like a basic operation. Is there a format that I can use for both desktop and laptop systems?