6.25.2013

powerpivot.ps1

#-
# For those that are still struggling with the Excel 2012 powerpivot add-in
# that comes disabled...
#-
add-type -AssemblyName microsoft.VisualBasic
add-type -AssemblyName System.Windows.Forms
start-sleep -Milliseconds 500
[Microsoft.VisualBasic.Interaction]::AppActivate("Microsoft Office Application Add-In") 
[System.Windows.Forms.SendKeys]::SendWait("{Enter}")   # error
start-sleep -Milliseconds 500
[Microsoft.VisualBasic.Interaction]::AppActivate("Microsoft Excel") 
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("%(Ft)")   # _File/Op_tions
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("(AA)")   # _Advanced ~ _Add-in
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("{Tab}P")   # Select list ~ _PowerPivot
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("%a")    # Select M_anage:
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("C{Tab}{Enter}")  # _Com Select _Go
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait(" {Tab}{Enter}")  # Check Powerpivot Select Ok
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("%g")    # Select Powerpivot menu
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("{Tab}")   # Select Powerpivot window
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("{Enter}")   # Open
start-sleep -Milliseconds 500
#[Microsoft.VisualBasic.Interaction]::AppActivate("PowerPivot for Excel") 
start-sleep -Milliseconds 30000
[System.Windows.Forms.SendKeys]::SendWait("%(Hw)")   # _Home / Diagram Vie_w

No comments:

Post a Comment