Again: Excel Automation - Change Font Size

Hi, I work with Excel- Automation and try to change the font size in a range. I use the following code: FontSize:= xlRange.Font.Size; xlRange.Font.Size:= FontSize - 2; Sometimes it works, sometimes it doesn’t work. But everytime ATTAIN (3.01 b) crashes down. Does somebody know why? Is there a workaround? TIA Andre

Andre, I found that sometimes seemingly the same operators behave differently. Try this: xlSheet.Range(‘A1:B2’).Font.Size = YourFontSize;

Hi Alex, thanks for your reply. Your suggestion was my first idea too and it is my current workaround for this problem. But, my idea was to handle this flexible. Dependent on the user font size my line should be two steps smaller. bye Andre