Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6785423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:07:30+00:00 2026-05-26T17:07:30+00:00

I am using Microsoft Office Interop to open Excel files. The file is placed

  • 0

I am using Microsoft Office Interop to open Excel files. The file is placed in a special folder from where it the Workbook code reads the file. Now, the requirement is that the Excel file can be placed anywhere. I believe the best approach is to attach the Excel file as an embedded resource. But if I attach as embedded resource how will I read the file using Excel workbook.

_excelapplication.Workbooks.Open(Filename: pExcelTemplatePath);

What is the best way to read the excel template file regardless of the location of the file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:07:30+00:00Added an answer on May 26, 2026 at 5:07 pm

    You can’t open it directly from the embedded resources – at least not with Interop…

    You will need to save it somewhere as a file – i.e. first read it from the resource (for example by Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceNameOfEmbeddedExcelFile)) and then write that stream to some location like ApplicationData / CommonApplicationData / LocalApplicationData / MyDocuments / CommonDocuments from Environment.SpecialFolder

    Another option would be to use a library capable of opening/editing Excel files from a stream – let me know if you need some links to libraries…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a web service that reads data from excel using Microsoft.Office.Interop.Excel. It works
This is the code I'm using to read an xls file: Microsoft.Office.Interop.Excel.Application excelApp =
I am creating an Excel Worksheet from C# using Microsoft.Office.Interop.Excel, and I have not
I have the following code: [Thank you Mike Rosenblum!] using System; using Microsoft.Office.Interop.Excel; using
I am using Microsoft.Office.Interop.Excel to read an excel file and change some cells. It
I'm using Microsoft.Office.Interop.Excel to create Excel file in C#, append data, change format and
I am using Microsoft.Office.Interop.Excel to read a spreadsheet that is open in memory. gXlWs
I'm using the following code to generate an Excel file using Microsoft.Interop.Excel. The problem
I am using Microsoft.Office.Interop.Excel.Application oExcelApp = (Microsoft.Office.Interop.Excel.Application)Marshal.GetActiveObject(Excel.Application); in my project. It gives me an
I have opened Excel file in my C# WinForm Application adding reference to Microsoft.Office.Interop.Excel.dll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.