Excel 2013

Welcome Forums General PowerShell Q&A Excel 2013

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
3 years, 6 months ago.

  • Author
    Posts
  • #25529

    Participant
    Points: 0
    Rank: Member

    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

  • #25542

    Participant
    Points: 0
    Rank: Member

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

  • #25543

    Participant
    Points: 0
    Rank: Member

    Thanks for testing my code.

  • #25602

    Participant
    Points: 60
    Rank: Member

    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)

The topic ‘Excel 2013’ is closed to new replies.