View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.charting
GS80 GS80 is offline
external usenet poster
 
Posts: 26
Default Range CopyPicture()

Think i'll go back and check out my code. I got a solution by selecting the
usedrange() method of the current worksheet. I'll let you know how it goes by
looking at the way i reference my objects.

Thanks for your patience.

G

"Jon Peltier" wrote:

If you reference your objects appropriately, you don't need to activate or
select anything. This test code gave me a picture of the appropriate region
in metafile format, even if another range was selected or another sheet was
active:

worksheets("Project Input (4)").range("F242:L262").copypicture
Appearance:=xlScreen, Format:=xlPicture

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"GS80" wrote in message
...
I did, and fair point about including the code.

I do however think that i have just resolved my problem. It appears that i
have to call the activate() method on the Worksheet containing the items I
need to copy. Without this method all i get is the cells and the cell data
returned.

Code will be forthcoming with any other posts.

Thanks,

G

"Jon Peltier" wrote:

Did you happen to use any code for this? If so, why not paste it.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"GS80" wrote in message
...
Hi,

I'm working on an app which i need to copy a range of cells which is
programatically generated using the Excel object model. I want to be
able
to
select the output range which consists of charts and cells making up a
table.
I'm using the CopyPicture() method of Range which i had woring once to
copy
the charts and cells combination into word. Having run this again it
won't
pull across the charts now. The areas where these are meant to go are
just
blank.

Has anyone experienced this before and could maybe give me some
information
on how to resolve this. I know it can be done as it worked once. I'm
wondering if the slight adjustment made to the chart upon which the
output
charts are based has upset something. Copying manually seems to work
but
the
formatting is skewed somewhat, hence the requirement of the picture to
be
used.

Any help will be greatly appreciated.

G