473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Can't copy Charts (pivot) from one worksheet to another in Excel 2007

2
Using C#, I need to copy the contents of one worksheet (Excel.Worksheet) to another worksheet. Everything gets copied (including pivot charts) when I execute the code for the 1st time. But when I execute the code again, the charts (pivot charts) in the source worksheet dont get copied to the destination worksheet in Excel 2007. This works fine in Excel 2003.
I'm using .NET 2.0!
can you please help me on this...

this is the code I'm using;

Expand|Select|Wrap|Line Numbers
  1. public static void copy(Excel.Worksheet src, Excel.Worksheet dest)
  2. {
  3.    Excel.Range range;
  4.    Excel.Range range2;
  5.  
  6.    range = src.get_Range(src.Cells[1, 1], src.Cells[src.Rows.Count, src.Columns.Count]); 
  7.    range2 = dest.get_Range(dest.Cells[1, 1], dest.Cells[1, 1]);
  8.    range.Copy(range2);
  9. }
  10.  
I posted the same question under the following thread as well "Copy worksheet not working" (microsoft access / vba), since it deals with the same issue.
Aug 10 '10 #1
0 1309

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rene | last post by:
Hi Proggies, i try to delete an excel worksheet but nothing happens (work on vb.net 2005) ..... xlSheet = xlApp.Sheets("Master") xlSheet.select xlSheet.delete also try
0
by: milkyman | last post by:
Hi everyone, Hope you can help me with this. I want to know if there is a way to copy a part of an Excel worksheet en put this as an picture in a picturebox. So if have got a Excel sheet(called...
0
by: das | last post by:
Hello all, I have tried this in SQL 2000 with no luck, with pivot table feature in 2005 I see some hope. Here is my problem, I have a table with n rows. data within these is simple varchar. I want...
2
by: BSB | last post by:
hi, I was working with excel 2000 contaning macros and pivot tables.It was working fine for years. My system is updated with excel 2007 now. The macros and pivot tables are not getting refreshed...
4
by: wellscrambled | last post by:
Folks, Probably don't have the right forum here, but this is all a bit new to me. I have a web site that sends me a daily email with an excel spreadsheet attachment that contains some customer...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
What I want to do is bring data into an excel 2007 worksheet that is stored in a sql database table. The idea is to parameterize the "where" clause in the sql select statement limiting the...
1
by: ccckidd | last post by:
Not sure what is going on. Trying to insert records into new worksheet using ADO command object, it runs fine, creates the new sheet and header row, but no data?? I have tried a few things, can get...
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
1
by: Ally | last post by:
Hi all, I’m looking to plot charts in Excel from python. After some Googling I’ve found the following code: def plot(x, y, xAxisLog=False, yAxisLog=False): # acquire application object, which...
1
newnewbie
by: newnewbie | last post by:
Hi, Short version: trying to export more than 65K of data from Access 2007 into Excel 2007 (important) through VBA. Access gives me 65K row limitation error, though I thought that was no longer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.