Prev: Hiding rows where text not entered to right of colums A and B
Next: Saving File with names from Text Box's
From: theLuggage on 24 Dec 2009 15:29 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.
From: joel on 24 Dec 2009 15:54 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]
From: "Jie Wang [MSFT]" on 25 Dec 2009 06:57 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(a)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.
From: theLuggage on 4 Jan 2010 14:10 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
From: theLuggage on 4 Jan 2010 14:20 Thanks for the suggestion. I still get the blank box when I run this in Excel 2007.
|
Next
|
Last
Pages: 1 2 Prev: Hiding rows where text not entered to right of colums A and B Next: Saving File with names from Text Box's |