I have been working real hard to reproduce this issue and my first step was to create this functionality with LabVIEW. I was easily able todo this by doing what you do above. I aquire a range reference then modify the linestyle property on borders. Now I tried to do this exact call in CVI and used your exact code and the....
Excel_SetProperty (ExcelRangeHandle, NULL,Excel_BordersLineStyle, CAVT_VARIANT, 4);
The only change I make is...
error = Excel_SetProperty (ExcelRangeHandle, NULL,Excel_BordersLineStyle, CAVT_VARIANT, 4);
now this command ends up throwing an 'Invalid Method Error' when it reaches this command
ReportAppAutomationError (error);
Therefore, for some unknown reason that is not a valid method in CVI. I will continue to look into
this but I wanted to let you know to see if it sparked anymore ideas on your end.
A workaround to this is you could always call a macro.
Hope this shines some light on the subject...
Have a great day!!!
Allan S.
Applications Engineering
National Instruments