Skip to content

Script Using ImportExcel Crashes #1713

@ccx004

Description

@ccx004

This statement:
write-host $WorkSheet.Cells["B2"].style.font.size
will print 10 on the screen because that is the font size of the B2 cell.

However, these statements:
[string] $SS= "style.font.size" write-host $WorkSheet.Cells["B2"].$SS
will write this instead:

Insufficient stack to continue executing the program safely. This can happen from having too many functions on the
call stack or function on the stack using too much stack space.

However, this:
[string] $SS= "size" write-host $WorkSheet.Cells["B2"].style.font.$SS
will work as expected.

How does ImportExcel know that it is a string with three items rather than a constant string with three items? I have tried putting quotes round the $SS as well as brackets and anything else I could think of but it made no difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions