473,769 Members | 2,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
Using C#, I need to copy the contents of one worksheet (Excel.Workshee t) 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 1331

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

Similar topics

3
15283
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
1768
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 Sheet1) and it contains some info. I want to select range A1:C12 and put a copy of this range in a picturebox i made on a UserForm. Is this posible and how do i do this. Thanks for helping me....
0
2230
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 to pull the data in these rows and create a table. Ex: Table1 data looks like this (actual table is much much bigger): # columnName
2
1352
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 properly... And it says there is some integrity problem. Can somebody help me on this??????????? thank u
4
2555
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 data. Sadly, now that I am using Excel 2007, I can't open the file for some reason. The code I am using to generate the file is below. Am I missing something obvious as it opens fine in Excel 2003. I am asking here as I think it's javascript, but...
1
1150
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 result set. There are lots of examples in the literature with regard to bringing in data stored in cubes --- but not so much from data in sql table. The basic issue is I want bring in descriptive information about say a
1
9392
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 Select statements to run against the connection, can even update the data in the workbook using a "Update set ='a' where ='1'" " statement, but no luck with this. My operating system is vista and this code resides in an Excel 2007 vba module. ...
9
3260
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 large my goal is to keep the devlopement in VB6 but am open to any ideas or suggestions. What i want to do is: 1. Keep my app in VB6 and find a workaround for the crappy looking charts. the charts now look very blocky and the grid lines and...
1
8780
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 may start application application = Dispatch("Excel.Application") # create new file ('Workbook' in Excel-vocabulary)
1
5833
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 an issue in Access/Excel 2007. Any hope? Long story: I have several databases with 400+ queries that I export into a folder as Excel files (with VBA). I then have some Excel macros that run through all the exported files and format them into...
0
9586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.