473,734 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copy pivot table

Hello,

I am working in Access 2003. I have a pivot table that looks very
good, and if I press CTRL+A, CTRL+C while in the PivotTable View then
it will be copied into memory. I can then do CTRL+P in Excel and it
pastes over great.

Is there a way to do this with OLE Automation (or some other way)? I
have been able to copy a PivotTable View of a Form to Excel with the
following code:

Set ptView = Forms("Form1"). PivotTable
ptView.Copy ptView.ActiveVi ew

'Then, create the new workbook
Set xlApp = CreateObject("E xcel.Applicatio n")
Set xlBook = xlApp.Workbooks .Add
Set xlSheet = xlBook.Workshee ts(1)
xlApp.Applicati on.Visible = True

'Select the cell where we need to begin the paste function
xlApp.Applicati on.Cells(1, 1).Select
'Paste the clipboard contents here from the copied pivot table
xlApp.ActiveShe et.Paste

This works great, but I have to Save my Query as a Form named "Form1".
This is no fun!

I would really like to skip the step of saving the Query as a form
(which I can not automate) by simply copying the contents of the Query
(in its pivot table view).

Thanks in advance!

Mike

Nov 13 '05 #1
1 3403
maybe you can grab the recordset and then use the code at MVPS.org to
send the recordset to Excel using automation.
See...
http://www.mvps.org/access/modules/mdl0035.htm

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5843
by: Rob | last post by:
I'm just getting around to using pivot tables and charts. I find the Pivot table interface to be INCREDIBLY frustrating. When I view a table in Design view, then choose Pivot table view, I get the PivotTable Field list, from which I can choose to add fields to the view. 1. How do you get RID of a field once you put it in? I can not right click on anywhere in the view and have ANY of the submenu options be availble. From the PivotTable...
1
3145
by: Grey | last post by:
I have created a asp.net form for user to input data. After input the data, user need to click a button to export the input data to excel for data analysis with excel pivot table function. is it possible to do that?? if so, any sample for me as i am a new in designing pivot table with asp.net million thanks
3
10265
by: Jerry K via DotNetMonster.com | last post by:
I'm creating a pivot table using vb.net and the data is from sqlserver (desktop). I have been successful at creating the pivot table, which includes a 'date' column field. I'd like to group the date column field by months and quarters, but can't come up with the correct code. Here is the code I've written to create the pivot table. Any help to code grouping the date column field would be appreciated. Thanks, Jerry
8
4869
by: Jerome Ranch | last post by:
Okay So I've got pivot tables setup in Access 2003. Only about 30K records in the current 2005 databases...the pivots summarize the info in a number of nice ways. I need to get the pivot tables into a document so I can distribute the tables, as is, as an electronic report (without the detailed data) So I export to rtf and xls, and I get an error that there is a too much information. I don't want all the data, just the summary table!
9
6796
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury Bonds, the Prime rate, and so-forth. We associate a security with one of those rates. There are a set of rates for each calendar day, and the rates for that
8
5931
by: PhilBowen | last post by:
I have created a pivot table making reference to a query. It works perfectly well. However, when I go out of the database and then back in the pivot table appears as a "form". I can click on the "design" icon to change back to pivot table. It is however frustrating to have to do this each time. I have checked the properties and everyhting appears to reference to pivot table. Can you please advise what I need to do to see the pivot table each...
5
4543
by: Pourya99 | last post by:
Hello, I have an Access Data Access Page which has a pivot table. The data source of the pivot table is a SQL database table. The data in the pivot table itself is not a problem. I have a text box below the pivot table. Let's say the pivot table has: First Name, Last Name, and Address. When I click on a record in the pivot table, I want the Address for that selected record to be displayed in the textbox below. What I have currently...
1
6830
by: christianlott1 | last post by:
I want to copy an Access pivot table into word with vba. I'm guessing I'd need to Select All, copy to the clipboard, and paste special into word at a bookmark. I know how to address the bookmark, I just don't know how to select, copy and paste (actually, I will probably be able to find the paste special command for word) via vba. Right now I have:
0
1194
by: barkarlo | last post by:
I make pivot table in excel. in page field is item month. in row field is employees. in column field is working hours,sunday hours, overtime and ect. Now I want with VBA code copy/paste only value of column overtime from pivot to another sheet. How?
0
8946
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
8776
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
9449
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
9310
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
9236
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
9182
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
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
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.