In Changeset 66336 I added support for some of the Excel VBA global variables:
  • ActiveCell
  • ActiveChart
  • ActivePrinter
  • ActiveSheet
  • ActiveWindow
  • ActiveWorkbook

globalsinaction.jpg

They are available in the PowerShell console as:
  • $ActiveCell
  • $ActiveChart
  • $ActivePrinter
  • $ActiveSheet
  • $ActiveWindow
  • $ActiveWorkbook

If these variables are not currently available (like when there are no open workbooks), the PowerShell variable values are null, so this is also convenient.

I needed to use PSVariable derived classes to make these available (see here: http://stackoverflow.com/questions/4580740/creating-powershell-automatic-variables-from-c).

Excel.Application was already available as $Application and the above variables are already available as its properties (as well as other globals).

Last edited Jan 3, 2011 at 6:37 PM by Urkec, version 3

Comments

No comments yet.