EBDN - Community - Question & Answers

  Monday, 28 January 2019
  1 Replies
  1.2K Visits
0
Votes
Undo
Hi,

How to read an excel file which is stored under the templates folder ? Example is shown in Image1

I have written the code as below:

public ObjectCollection TokenTemplate;

foreach (ObjectItem child in myApplication.Folders.Templates.Children)
{

if (child.Name == "Configurations";)
{
TokenTemplate = child.FindObjects(ObjectKind.Folder, SearchBehavior.Deep);
foreach (var folder in TokenTemplate)
{
if (folder.Name == "Token Utilization";)
{
foreach (var file in folder.Children)
{

ObjectItem ExcelFile = file;

ExApplication exApplication = myApplication as ExApplication;
exApplication.ExtendedUtils.ExecuteCommand(OperationCommand.Execute, ExcelFile)

}
}

}

}

}


The problem is, it only opens the excel file. Are there any possibilities to read the excel file from templates folder?

Thank you.

Regards,
Yuvarani