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

  • SEARCH
  • Home
  • 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 4087482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:51:39+00:00 2026-05-20T18:51:39+00:00

One of our applications allows users to generate an Excel file using an Excel

  • 0

One of our applications allows users to generate an Excel file using an Excel Template (that is installed/deployed using Click Once). This is a VSTO application.

The Excel file is genereted by storing some values in the registry and “calling” the template using the following code (the coluymns are pulled from two different lists, a “required” list and an “optional list”:

private void myButtonExport_Click(object sender, EventArgs e)
{
    if (CurrentTableRow == null) return;
    if (CurrentTemplateRow == null) return;

    List<string> requiredColumns = excelTemplateTableDS.GetColumnsList(false);
    List<string> myColumns = userTableDS.GetColumnsList(false);
    string selectStatement;

    try
    {
        CustomerListColumnSelect f = new CustomerListColumnSelect(myColumns, requiredColumns);
        if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
        {
            selectStatement = string.Format("SELECT {0} FROM [{1}]", string.Join(", ", f.SelectedColumns.ToArray()), CurrentTableRow.TableName);

            Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Company\Collection Development");
            rk.DeleteValue("TemplateTableName", false);
            rk.DeleteValue("TemplateSelectStatement", false);
            rk.SetValue("TemplateTableName", CurrentTableRow.TableName, Microsoft.Win32.RegistryValueKind.String);
            rk.SetValue("TemplateSelectStatement", selectStatement, Microsoft.Win32.RegistryValueKind.String);
            rk.Close();

            // Launch Excel
            AppLog.WriteEvent("CreateCustomerList", TraceEventType.Information,
                string.Format("Creating customer list [{0}] using table [{1}]", CurrentTemplateRow.TemplateName, CurrentTableRow.TableName));
            if (Debugger.IsAttached)
            {
                FileInfo fi = new FileInfo(CurrentTemplateRow.Path);
                string newPath = string.Format(@"C:\Documents and Settings\mpetrie\My Documents\Visual Studio 2010\Projects\Collection Development Templates\{0}\bin\Release\{1}", CurrentTemplateRow.TemplateName, fi.Name);
                // If running under DEBUG (and app not installed), then launch latest version
                Process.Start(newPath);
            }
            else
            {
                Process.Start(CurrentTemplateRow.Path);
            }
        }
        f.Dispose();
    }
    catch (Exception ex)
    {
        MessageBox.Show(this, CurrentTemplateRow.Path + "\r\n" + ex.Message, "Process.Start", MessageBoxButtons.OK, MessageBoxIcon.Error);
        ResetSteps(sender, e);
        return;
    }
}

Then, each template has “a bunch” of code to load the data (using the values in the Registry) into the spreradsheet. (This part never has an issue, it is AFTER the excel file has been saved and someone tries to open it).

I am new to this application and VSTO in general. What I am a little unclear on is how the file gets saved. I assume when it gets saved, all of the associated “code” from the template does NOT get saved with the file, only the data gets saved…

Ocassionally, our users are unable to open the file. Excel never gives an error, it just “spins” like it is trying to open the file. We have waited up to 30 minutes or longer with no results. It “seems” like the file gets opened, but never “painted” (rendered), but that is just a guess. This is very random. Sometimes, the same file can be opened by other users and sometimes the user that had problems can try again later and the file opens just fine.

We have several “ideas” what could be causing the problem from: AntiVirus to Networking shares. Although, it is such a random issue we don’t know how to debug this when it happens (it may not happen again for hours or days). The users report they don’t have issues opening any other Excel files, only the files generated by this application.

Does anyone have any ideas what could be causing this??

Shayne

  • 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-20T18:51:40+00:00Added an answer on May 20, 2026 at 6:51 pm

    My description of this problem was completely wrong. After seeing the problem first hand today. The issue is the file opens, but isn’t visible. I am going to start a new thread that better describes the problem.

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

Sidebar

Related Questions

One of our applications is started suddenly terminate with error Can't load file or
We have some performance problems with one of our applications. I thought about using
We are using squid for one of our applications and we are getting an
Our product contains a task-manager system that allows applications to run code in a
This problem is a challenging one. Our application allows users to post news on
I am currently working on a program in C# that allows our users to
Our web applications are using LDAP Membership Provider to authenticate and register users in
One of our applications is exhibiting poor network behavior on Vista due to the
In one of our applications we need to call the Yahoo Soap Webservice to
I'm trying to find a memory leak in one of our applications, however it's

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.