Forum Discussion

nish_b's avatar
nish_b
Contributor
5 years ago
Solved

How to view all the methods available in Sys.OleObject COM object

Hi,

 

I am trying to interact with Excel file using a reference to the Excel.Application COM object. My original problem is that I want to get the code/method to get the current cell value type. For example, for a particular cell I want the current format type (General/Text/Custom). If it is in General format, I want to change to Text format. How can I do that? I have tried to use the Code completion to find available methods. I want to be able to view all the available methods using the Code Completion pop-up, but it doesn't load always. It acts like loading and then closes the pop-up without any results.

 

Example code snippet of how I interact with Excel COM object: 

let excel = Sys.OleObject("Excel.Application");
excel.Workbooks.Open(excelFile);
var xlsheet = excel.ActiveWorkBook.WorkSheets.Item(sheetName);

 

Please let me know if any more details are needed