Excel OLAPPaste VBA Example


The following is sample VBA relating to OLAPPaste.  


The sample shows the following: 

  1. Selecting a cell 
  2. Copying a value 
  3. Selecting a destination 
  4. Commented code example of a standard Excel Paste 
  5. Active code example of PowerOLAP OLAPPaste.


Sub Simple_OLAPPaste_Example()

    Range("H9").Select
    Selection.Copy
    Range("G9").Select

    'This is standard excel paste
    'ActiveSheet.Paste

    'Replace standard excel paste with "OLAPPaste"
    Application.Run ("OLAPPaste")

    Application.CutCopyMode = False
    Calculate
   
   
End Sub