03-13-2023
08:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-13-2023
08:10 AM
Get and set row height and font size of Excel worksheet cells
Hi everybody!
Lately I've been trying to create external Excel sheets with iLogic, with the Excel API/object. Filling in cells is not an issue, but I'm not able to change the font and/or font size of cells/ranges in the Excel sheet.
First I tried to retrieve the current Font size with this function:
Logger.Info("Fontsize " & ExcelSH.Range("A1:A1").Font.Size)But this doesn't work, iLogic returns the error: "Object reference not set to an instance of an object.".
Also tried to retrieve the rowheight by this snippet:
Logger.Info("Row height " & ExcelSH.Rows.Item(1).RowHeight)But this also returns the above mentioned error.
I'm doubting if it's in anyway possible to change the formatting of cells in Excel through iLogic. Maybe some of you could help me with this?
Thanks!
Product Design Suite 2024
Inventor 2024 (v 28.20.27200.0000), Vault Basic 2024
Fusion 360
HP Workstation Z4
Intel Xeon 3.4GHz
32GB RAM
Windows 10 Professional (64bit)