Interop.Excel always saving in default path even specifying the path manually for Office 365

Venkatachalam S1 0 Reputation points
2024-05-20T11:08:56.84+00:00

Trying to create an Excel file using Office.Interop.dll (15.0.4795.1001).But it is taking the default file path instead of the path which set manually.

            if (extensionObj != null)

            {

                relativeExcelPath = string.Concat(System.IO.Path.GetDirectoryName(extensionObj.WorkflowPath), "\\", workflowName);

            }

            // Checking if excel file is present in workflow running directory, if exists then open the file in workflow running directory otherwise 

            // continue with user supplied path.

            excelPath = System.IO.File.Exists(relativeExcelPath) ? relativeExcelPath : context.GetValue(Path);
```public static void SaveExcel(excel.Workbook myWorkBook)

{

    excel.Application myApp;

    myApp = new excel.Application();

    myWorkBook.Save()
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,461 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,632 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,668 questions
0 comments No comments
{count} votes