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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PasteSpecial Macro

Status
Not open for further replies.

ohmbru2

Technical User
Jul 24, 2001
51
US
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.

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?
 
You'd be better off pasting in one of VBA or Office forums.

I suspect the laptops got a minimum install. I can't remember specifically which part of office is needed for this function to work - but if you can install office again on the laptops that will be your quickest solution. Office doesn't need a full install. It should allow you to add/remove components. You just need to add something.

Sorry I can't be more specific.

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top