Author Posts

May 21, 2015 at 6:52 am

At work I have Excel 2010 and I use the following code which works fine

Add-Type -AssemblyName Microsoft.Office.Interop.Excel
$excel = New-Object -ComObject Excel.Application
$excel.Visible = $true
$workbook = $excel.Workbooks.add()
$wrksht = $workbook.Worksheets.Item("Sheet1")
$wrksht.Name = "Hello"

The same code in Excel 2013 only opens excel and gives me 1 sheet and does not rename sheet1 like in Excel 2010

May 21, 2015 at 10:15 am

I've just tested your code using Excel 2013 and the rename worked for me

May 21, 2015 at 10:36 am

Thanks for testing my code.

May 23, 2015 at 2:28 am

Hey Wilfredo,

+1 for it working okay, just tried in on my system with O2K13 and it works good.

Do you have any autoload macros configured for excel, or any additional security settings?
Maybe an idea to also try with a clean profile. Trying creating a new user local user on your system, login with that, and try it (you might need to run excel once before to get rid of all the first start stuff)