Connecting Tech Pros Worldwide Help | Site Map

Pivot Table to Word (via vba copy/paste)

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 11th, 2007, 04:45 PM
christianlott1@yahoo.com
Guest
 
Posts: n/a
Default Pivot Table to Word (via vba copy/paste)

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:
--------------
DoCmd.OpenForm "frm_pvt_Amend_Area_Union2", acFormPivotTable

SendKeys ("^a")
SendKeys ("^c")

DoCmd.Close acForm, "frm_pvt_Amend_Area_Union2"
---------------

I'm going to need to cause the routine to 'wait' or 'sleep' before I
close the pivot table form because right now it closes before the keys
reach it. Other than that it pastes fine.

These commands didn't work for me (caused an error - only available in
design mode?):

'DoCmd.RunCommand acCmdSelectAll
'DoCmd.RunCommand acCmdCopy



Thanks,

Christian


  #2  
Old July 12th, 2007, 05:45 PM
christianlott1@yahoo.com
Guest
 
Posts: n/a
Default Re: Pivot Table to Word (via vba copy/paste)

On Jul 12, 9:06 am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
Quote:
On Wed, 11 Jul 2007 13:04:35 -0700, "christianlo...@yahoo.com"
>
<christianlo...@yahoo.comwrote:
>
Sendkeys has an extra optional argument to make things more
sequential. Read up on it in the help file.
Thanks for that!

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.