PlanMaker and PowerShell

Questions and answers about PlanMaker 2018 for Windows
Post Reply
Posts: 134
Joined: Mon Oct 01, 2007 11:40 pm

PlanMaker and PowerShell

Post by EricC » Sun Sep 22, 2019 10:07 pm


So I am playing around with PlanMaker and PowerShell. I am basing some of this code off code I have from a PowerShell script to enumerate AD groups and populate an Excel spreadsheet. Starting small, I thought I would create the spreadsheet and autofit the column.

$groupName = 'somereallylongname'
$row = 1
$column = 1
$pmSpreadsheet = New-Object -ComObject PlanMaker.Application
$pmSpreadsheet.Visible = $True
$workbook = $pmSpreadsheet.Workbooks.Add()
$worksheet = $workbook.ActiveSheet
$worksheet.Cells.Item($row, $column).Value = $groupName

If run the above code in a PowerShell console everything works up until the AutoFit. Which throws the following message:

void AutoFit ()

I converted the code to BasicScript, ran it in the BasicScript editor, and everything works as expected.

Any ideas?


W10 1903 x64
SMO2018 x64 Rev970

Post Reply

Return to “PlanMaker 2018 for Windows”