Problem copying table data as a picture onto chartsheet

I'm having a strange problem. I'm creating a special chart which has a pie 
chart on it as well as some tabular data that is formatted the way we want it 
on a worksheet, then pasted onto the chartsheet as a picture. (The pie chart 
aspect is working fine. I'm just having a problem with the tabular data.)

When I copy the tabular data manually by selecting the data on the 
worksheet, then going to the Home tab and choosing the Paste menu dropdown, 
then "As Picture", then "Copy as picture...".  In the resulting dialog box, I 
choose "As shown on screen" and "Bitmap".  Then I switch to the chartsheet 
and paste the picture onto the sheet (I just hit ctrl-v).

The tablular data looks great.

Then I used the macro recorder to record those actions and here's the code I 
get:
    Sheets("ScratchArea").Select
    Range("A22:B29").Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    Sheets("Figure 21C").Select
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.Paste


When I run this code, all I get is a blank picture box on the Chartsheet.  
The tabular data is not there inside the picture box.

I've tried different variations on the recorded code and they all give me 
the same result. Here's one of those variations:

    Sheets("ScratchArea").Select
    Range("A22:B29").Select
    Selection.Copy
    ActiveWorkbook.Sheets("Figure 21C").Select
    ActiveChart.ChartArea.Select
    ActiveChart.Pictures.Paste.Select


Any help would be most appreciated. I can send sample worksheets if needed.


0
Utf
12/24/2009 8:29:01 PM
excel.programming 6508 articles. 2 followers. Follow

8 Replies
1143 Views

Similar Articles

[PageSpeed] 38

this works in 2003


With Sheets("ScratchArea")
.Range("A22:B29").CopyPicture Appearance:=xlScreen, _
Format:=xlBitmap

End With

With Sheets("Figure 21C")

.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.Paste

End With


-- 
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=165045

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
joel
12/24/2009 8:54:03 PM
Hi,

You can also try this (I wrote an run it without any problems on Excel 
2007):

Sheets("ScratchArea").Select
Range("A22:B29").Select

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

Sheets("Figure 21C").Select
ActiveChart.ChartArea.Select
ActiveChart.Pictures.Paste.Select

Please let me know how it goes.

Thanks,
Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 2 business days is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions. Issues of this 
nature are best handled working with a dedicated Microsoft Support Engineer 
by contacting Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

0
jiewan
12/25/2009 11:57:09 AM
Thanks for your suggestion.  I was away over the holidays, hence the delay in 
my response.

When I try your code, I get this error when it executes the 
"ActiveChart.Pictures.Paste.Select" code:


Error number: 1004
Error description: Unable to get the Paste property of the Pictures class
0
Utf
1/4/2010 7:10:01 PM
Thanks for the suggestion.

I still get the blank box when I run this in Excel 2007.
0
Utf
1/4/2010 7:20:02 PM
My code should work if the sheet names and chart object name is correct.
Yo need to activate the chartobject like I did below then select the
plot area.

With Sheets("ScratchArea")
.Range("A22:B29").CopyPicture Appearance:=xlScreen, _
Format:=xlBitmap

End With

With Sheets("Figure 21C")

.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.Paste

End With


-- 
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=165045

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
joel
1/4/2010 7:46:01 PM
Your code works, in the sense that it executes without giving any errors, 
but I still just get a blank picture box with nothing in it.

It looks to me like the problem is with the copy itself, rather than the 
paste because I ran the code up to the point where it does the .CopyPicture, 
then stopped it.

Then I switched to Word 2007 and did a Ctrl-V just to see what was placed on 
the clipboard, and all I get is an empty picture box.

This is really weird.  I wonder if this is a service pack issue?  Perhaps I 
have (or don't have) some Office update that you do (or don't) have.
0
Utf
1/4/2010 9:04:02 PM
I changed the code from:
"ActiveChart.Pictures.Paste.Select"

to:

"ActiveSheet.Pictures.Paste.Select"

And it worked fine.

It looks like the trick is to use "Format:=xlPicture" instead of xlBitmap.

Thanks for the help.
0
Utf
1/4/2010 9:17:02 PM
Alright, when I tested the code, I used a chart sheet so my code ended up 
with "ActiveChart".

Good to know it's working now.

Have a nice day!

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 2 business days is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions. Issues of this 
nature are best handled working with a dedicated Microsoft Support Engineer 
by contacting Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

0
jiewan
1/5/2010 1:10:22 PM
Reply:

Similar Artilces:

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <u8526505@gmail.com> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Excel copy and paste #2
Excel 2000 1) there are times when I can only paste values and not formulas from one workbook to another even though I am using Edit/Copy and Edit/Paste process. 2) there are times when I cannot copy and paste between workbooks launched from Edit/Copy, Edit/paste, or CTRL C, CTRL V or from shortcut menu. The only way is to use the clipboard which does not copy formulas. we have referred to 209338 and 209284 but the stated solution doesn't always work. ...

pivot table grand totals not showing for all columns...
i have a pivot table that shows the grand total for some columns, but not for others... there are no differences in the data layout, yet this happens? any clues as to why? and how I can get the grand totals to show for all fields. thanx in the PivotTable floating toolbar, click PviotTable, then Table Options, select 'Grand totals for columns' option. ...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' (http://rapidshare.com/files/347103149/Minidump.rar.html) Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <guest@unknown-email.com> wrote in message news:0b9a0c60b90bf6c0be88bda30f2820ab@nntp-gateway.com... > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

Copy Filtered Data
I am filtering my data that is in the range A:AJ starting on row 13 with headers and having a variable ending row. My filter criteria is Column 1 not blank and Column 11 ="s". I would like to copy the filtered date (No headers) to another work book beginning in BE3. Thanks! Hi, Once the data is filtered, highlight it, press CTRL + G, special, visible cells only, press CTRL + C, go to the sheet where you want the information and press CTRL + V "sailor4life61@yahoo.com" wrote: > I am filtering my data that is in the range A:AJ starting on row 13 > wi...

SQL 2005 patition table
Hi, I have 20 million (5 type record ids -- 2-3gb)records need to be loaded into a table daily. Is it a good idea to have a a patiotion table seperated by reciord type id. 1. It will be faster for retrieval in performance? 2. What is the drawbacks ot have a partitioned table instead of regular table? Thanks, Mecn My opinion is 1) It will be fatser if the user searches on particular typeid , if he/she searches on typedid 1 and 5 then it will 'scan' two partitions 2) You have to have some experience to maintain partitons "Mecn" <mecn@yahoo.com> ...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

VB Script to copy incremental data from one sheet of workbook to o
Hi, I am looking for a script that can copy the incremental data in existing sheet to another sheet in the same workbook, just want to copy the incremental data of 3 column, i.e. column A,B and S of the existing sheet. I am using excel 2007 Hi, What is 'incremental data' and how do we recognise it and distinguish it from other data in those columns? -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Samarth" wrote: > Hi, > ...

how to skip a column when entering data?
On one worksheet, for the sake of appearance Column B contains a calculated amount, which is the product of Column A and Column C. Is there a way to skip to column C when entering the data in Column A without doing it manually? Thanks, Godzilla This will give you the idea. right click on sheet tab>view code>insert this>SAVE Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Row > 2 And Target.Column = 1 Then ActiveCell.Offset(, 2).Select End Sub "Godzilla" <Godzilla@monster.org> wrote in message news:MPG.19e3d6a7ae92e03398971a@news....

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Extender-Create a new data entry window
Is it possible to create a new extender form or window (not sure of the terminology) to enter data into Dynamics? Specifically the Sales Forecast Window in Manufacturing is terrible for entering data, everytime you move to the right, it the scrolling window jumps back to the top and you have to find the item again. Anyway, I would like a new window to enter a sales forecast, is this possible? thanks -- Doug Unfortunately Extender data is stored in Extender tables and cannot be stored in the Sales Forecast tables. I agree with you that the data entry screen is horrible. I am tal...

Data Ribbon disabled
I'm trying to do a "what-if analysis" for my beginning Excel class and when I click on the appropriate cell and then the Data ribbon, all of the options are greyed out. While struggling with this, I noticed the options on the Insert ribbon are also greyed out but the other tabs are fine. I appreciate any insight. Hi, Check the Review tab, the worksheet may be protected. Check you do not have multiple sheets selected, [Group] will be displayed in the title bar is you have. Cheers Andy Akcath wrote: > I'm trying to do a "what-if analysis"...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

How to copy maps and inserted arrows in OneNote.
In OneNote, I inserted a Mapquest neighborhood map. I put a red arrow to point out my house. When I copy the map to my yahoo email, the red arrow doesn't paste. Any ideas? Can I group all the objects to become one? You could screen grab it (Windows Key + S) to the clipboard and then paste that image into your Yahoo mail. -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.html Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "ggilmore48" <ggilm...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Pivot Table #56
I am trying to create a Pivot table in Excel, using Microsoft Query linking to SQL database. SQL stores the date as Date/Time. It becomes impossible to group in Excel using Pivot Table, by date/time. I want to create a record in Microsoft query using the date field, but convert to Date only as dd/mm/yyyy and retain the format as Date and not as Text. I have tried Left(Date,11) and Convert(VARCHAR,1,101), none of them work. Could someone help me with the correct syntax. Microsoft query does not recognize MID. Thanks Krish ...

Using Checkboxes to add data to a table.
I have been having trouble developing this form for a couple of days. It seems the solution should be simple but so am I. I have an input form with four text boxes. I need to use the same data and create a new line in the table for up to but not always 9 different company positions. I was given a possible way of keeping the info on the form for the next position using the AfterUpdate event and setting the default back to the same box. But in using his suggestion I get #NAME? for the boxes with text when I select the next new record. The boxes with numbers come back the way he said it wo...