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 4327670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:34:17+00:00 2026-05-21T09:34:17+00:00

I am on my first foray into Excel Interop and after a flying start

  • 0

I am on my first foray into Excel Interop and after a flying start have hit a wall.

I have an Excel template that contains one sheet which is an assessment form and another which contains guidance notes for how to carry out the assessment.

I also have an XML file with the details of the projects being assessed.

I need to merge the project title, application number and company name into the first sheet and then save the sheet with the filename [Application No] – [Project Title].xlsx.

The first part is working fine. I have Loaded the XML and the code is putting the data into the form where it should be.

My problem is the saving part. I found the .SaveAs method and it creates a couple of files… but they won’t open. I then get a HRESULT error 0x800A03EC – Searching the web has explained nothing about this. Something is telling me that this.SaveAs() is referring to the worksheet rather than the work book but I am just guessing there.

I am hoping I have done something stupid and it is an easy fix.

For reference here is my code but like I say I am not sure how useful it is.

    private void MergeData()
    {
        doc.Load(@"C:\XML Data\source.xml");

        XmlNodeList forms = doc.SelectNodes("//form1");

        for (int i = 0; i < forms.Count; i++)
        {
            XmlNodeList nodes = forms[i].ChildNodes;

            string refNo = nodes[0].InnerText.ToString();
            string companyName = nodes[3].InnerText.ToString();
            string title = nodes[1].InnerText.ToString();

            this.Cells[9, 4] = title;
            this.Cells[11, 4] = refNo;
            this.Cells[14, 4] = companyName;


            this.SaveAs(@"C:\Assessment Forms\" + refNo + " - " + title + ".xlsx");
        }
    }

Does anyone know how to save these files?

Thanks for reading

EDIT–

I have found this article

C# and Excel Interop issue, Saving the excel file not smooth

and changed the code to include its suggestion

Excel.Application app = this.Application;
Excel.Workbook wb = app.Workbooks.Add(missing);
wb.SaveAs(@"C:\Assessment Forms\" + refNo + " - " + title + ".xlsx");

But it is doing the same.

I am on a deadline so think I am going to have to start copying, pasting and saving manually 🙁

  • 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-21T09:34:18+00:00Added an answer on May 21, 2026 at 9:34 am

    Not sure what object this is here, but if you are correct in assuming this is a worksheet, try this.Parent.SaveAs

    Alternatively if this turns out to be a range, try this.Worksheet.Parent.SaveAs

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

Sidebar

Related Questions

I'm making my first foray into WPF - I have a simple form with
For my first foray into python, I wrote some parsing code that works as
My first foray into writing jQuery functions. I have this function, but I'm not
My first foray into the quirky world of emacs lisp is a function which
I am taking my first foray into PHP programming and need to configure the
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My
This is my first foray into designing two versions of images for retina or
I am making my first foray into scala for a production app. The app
I've worked with CakePHP 1.3, but this is my first foray into CakePHP 2.0
I'm picking up ObjC and Cocoa, which is also my first serious foray into

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.