Results 1 to 3 of 3
  1. #1
    heliotropic is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    2

    Question Design Menu's Export to Excel functionality in VBA


    I have a PivotTable form that I need users to be able to export to Excel, however menus are disabled for them, so I need to accomplish this via a button that runs a VBA event procedure. The problem I'm having is I can't duplicate the functionality the "Export to Excel" button in the PivotTable Tools Design menu has.

    The code I've been trying has been something along the lines of:
    Code:
    DoCmd.OpenForm "frmPCPivot", acFormPivotTable
    DoCmd.RunCommand acCmdExportExcel
    DoCmd.Close
    The resulting file is just the unformatted data that would appear in the pivot. acCmdExportExcel seems to perform the same function as the Excel button in the Export section of the External Data tab. The button in the design menu does exactly what I want, I just can't figure out how to call it.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Google: Access vba export pivot table excel

    http://social.msdn.microsoft.com/For...1-0bc7327202c6
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    heliotropic is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    2
    Thanks for the link. I tried the code as they posted and it did not work out for me, however it led me to trying the acCmdPivotTableExportToExcel command in my code which does work like I want it to.
    Code:
    DoCmd.OpenForm "frmPCPivot", acFormPivotTable
    DoCmd.RunCommand acCmdPivotTableExportToExcel
    DoCmd.Close

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-03-2013, 11:25 PM
  2. ask - Design View menu can't be accessed
    By suka2 in forum Access
    Replies: 3
    Last Post: 01-31-2013, 10:56 PM
  3. Design Menu Items not working
    By 400Lifer in forum Misc
    Replies: 1
    Last Post: 05-05-2012, 10:18 AM
  4. Change right mouse menu in Design View ?
    By byterbit in forum Access
    Replies: 1
    Last Post: 02-03-2011, 11:29 PM
  5. Replies: 1
    Last Post: 06-16-2010, 11:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums