View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Pasting pictures from Excel to Word (2000)

Robin,

According to my Word help file the "FileName" argument is only used
when the Application is printed, not when the ActiveDocument is
printed. Just remove it (and the comma).

Regards,
Jim Cone
San Francisco, USA


"Robin" wrote in message
...
Jim, thanks for your suggestion. It solved that problem -
The code didn't know which selection to paste to, so I was able to fix that.
I've run into a another problem at the last part of my code - here is the
entire sub:

Private Sub Print_BL_Click()


- snip -

I'm getting a compile error at the next line, "Named Argument Not Found"
with "Filename:="" highlighted:

WordApp.ActiveDocument.PrintOut Filename:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=3, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False,
PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

Is this because I used FileName:=SaveDocName in the Save routine just above
this line? Below is the end of the Sub:

WordApp.Quit
Set BlankBL = Nothing
Set WordApp = Nothing
End Sub




"Jim Cone" wrote:

Robin,
Are you doing this from Excel or from Word?
How are you opening the "other" application?
What I am getting at is... Are you sure you know
what "Selection" is referring to?
Jim Cone
San Francisco, USA




"Robin" wrote in message
...
I am trying to copy from Excel 2000 as a picture and then paste into Word
2000 as a picture. My code will select the contiguous range, but when it
gets to this command:

Selection.CopyPicture Appearance:=xlScreen, Size:=xlScreen,
Format:=xlPicture

I get a run-time error 1004: Application-Defined or Object-Defined Error. I
haven't been able to determine which object is causing this error.

I tried earlier to simply copy the selection in Excel and PasteSpecial into
Word, but nothing seems to get pasted, even thought the code opens the
correct document. When the code finishes, I can manually paste the clipboard
contents, so I know it isn't empty.

Thanks to anyone who can help with this.