Pivot Table to CSV File - VBA

Discussion in 'Outlook VBA and Custom Forms' started by Alexa, May 17, 2017.

Tags:
  1. Alexa

    Alexa

    New Member
    Hello all,

    I am trying to convert a pivot table to a functional csv file. This is what I have so far but keep getting error messages. Any suggestions would be so very appreciated.

    Thanks!
    Alexa

    sub Export_To_Excel_View1

    Dim xlApp
    Dim xlBook
    Dim xlSheet


    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = true

    Set xlBook = xlApp.Workbooks.Add
    Set xlSheet = xlBook.Worksheets("Sheet1")

    Set Doc = ActiveDocument

    Doc.GetSheetObject("CH89").CopyTableToClipBoard true
    xlApp.ActiveSheet.Range("A1").Select
    xlApp.ActiveSheet.Paste

    end sub
     
  2. Diane Poremsky

    Diane Poremsky

    Senior Member
Loading...

Share This Page