Help with pasting into Word

McLaren

Board Regular
Joined
Jul 12, 2003
Messages
122
Greetings everyone, I was hoping someone could help me out. I have some excel files that use VBA to paste information into word which worked fine with older versions of Office. Now I am on a new computer with Office 2007 and everything got hosed. The file is still being created on the desktop, but now there is nothing in it. If I try to paste into notepad a blank line shows up with nothing else, however if I try to paste back into excel the data is there.

Thank you in advance for your time, any replies are appreciated.

Code:
    Dim appWD As Word.Application
    Set appWD = CreateObject("Word.Application.8")
    appWD.Visible = False
    Sheets("Calculator").Select
        Sheets("Template").Range("A2").Value = Range("J1").Value
        Sheets("Template").Range("A39").Value = Range("J20").Value
        Sheets("Template").Select
        Range("A1:A49").Copy
appWD.Documents.Add
appWD.Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile
appWD.ActiveDocument.SaveAs FileName:="C:\Documents and Settings\All Users\Desktop\cans.nc", FileFormat:=wdFormatText
appWD.ActiveDocument.Close
appWD.Quit
Sheets("Calculator").Select
 
First test looks like it's working like a champ! Thanks a ton ZVI. I'm going to do some more testing.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,216,028
Messages
6,128,399
Members
449,447
Latest member
M V Arun

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top