Exception from HRESULT: 0x800A03EC - COM Exception Unhandled

MS EXCEL

    Next

  • 1. txtbox no right click copy menu available?
    I need to highlight the contents of a textbox and copy it to th clipboard. Momentarily it will be pasted into another application a the file name to save that applications file as. I can drag the mouse and highlight the .Text. I can then Ctrl-c t copy the text to the clipboard. Then I can Ctrl-V or left click th mouse and paste the .Text and save the file. I would like to right click the mouse and have it select and copy th txtbox.Text to the clipboard automatically. I must be missing something simple. Thanks for your suggestions, Craig
  • 2. Macro to change macro or module level const that is calculated
    Is it possible to use a macro to change another macro. I have two Module level constant that i use Const numCol As Integer = 19 Const numWS As Integer = 3 Ideally, these number can change automatically. It won't work if i delcare a const with something such as Const numWS As Integer = Application.WorksheetFunction.CountA(Worksheets("Sheet1").Range("G:G")) How can I make this work? I am thinking that maybe calling a macro in another module can change this. Steven
  • 3. determine if wrap text is set within a range
    is it possible to determine if a cell or multiple cells within a range have the wrap text property set to true? And then to get the addresses of those cells? tia, dk
  • 4. fill a cell from a c application
    Hi, I've found the example code in the msdn to startup the excel program from a c-application (win32 console, no c++ and mfc -> Article ID: 181473). I am new to using com and if I understood correctly, I have to use the invoke routine to do all excel actions. The question is: what actions are available (where can I find detailed information about it) and how do I use them? Other question: is it better to create excel files from an mfc application (if so, what are the arguments)? TIA, Frank
  • 5. Do you want to replace existing file?
    I have written some code to "Save As..." a specific workbook, which I will assign to a command button. This procedure will be used frequently and I need no archive of old files. The problem I am having is the Microsoft prompt that asks if I want to replace the existing file. Can someone provide me with the code to always make the answer "Yes" so I no longer receive this prompt? Much appreciated!

Exception from HRESULT: 0x800A03EC - COM Exception Unhandled

Postby S2FydGhpemVu » Sun, 15 Mar 2009 09:47:01 GMT

i,

I am working on exporting data from a dataset to excel. When I used save
file dialog to save the file in a desired path I came across this Error.

Please find below the code I have used

using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace EXPORT_DATASET_EXCEL_II
{
static class ExportingCellByCellMethod
{

public static void ExportToExcel(DataSet dataSet, string outputPath)
// public static void ExportToExcel(DataSet dataSet)
{

// Create the Excel Application object
ApplicationClass excelApp = new ApplicationClass();
//excelApp.Interactive = false;
// Create a new Excel Workbook
Workbook excelWorkbook = excelApp.Workbooks.Add(Type.Missing);

int sheetIndex = 0;

// Copy each DataTable as a new Sheet
foreach (System.Data.DataTable dt in dataSet.Tables)
{

// Create a new Sheet
Worksheet excelSheet = (Worksheet)excelWorkbook.Sheets.Add(
excelWorkbook.Sheets.get_Item(++sheetIndex),
Type.Missing, 1, XlSheetType.xlWorksheet);

excelSheet.Name = dt.TableName;


// Copy the column names (cell-by-cell)
for (int col = 0; col < dt.Columns.Count; col++)
{
excelSheet.Cells[1, col + 1] = dt.Columns[col].ColumnName;
}



// Copy the values (cell-by-cell)
for (int col = 0; col < dt.Columns.Count; col++)
{
for (int row = 0; row < dt.Rows.Count; row++)
{
excelSheet.Cells[row + 2, col + 1] =
dt.Rows[row].ItemArray[col];
((Range)excelSheet.Rows[1,
Type.Missing]).AutoFit();
}

((Range)excelSheet.Columns[1,
Type.Missing]).AutoFit();
((Range)excelSheet.Columns[2,
Type.Missing]).AutoFit();
((Range)excelSheet.Columns[3,
Type.Missing]).AutoFit();

}

}


// Save and Close the Workbook

excelWorkbook.SaveAs(outputPath,
XlFileFormat.xlWorkbookNormal, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
XlSaveAsAccessMode.xlExclusive,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing);
excelWorkbook.Close(true, Type.Missing, Type.Missing);


excelWorkbook = null;

// Release the Application object
excelApp.Quit();
excelApp = null;

// Collect the unreferenced objects
GC.Collect();
GC.WaitForPendingFinalizers();

}

}

}


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
us

RE: Exception from HRESULT: 0x800A03EC - COM Exception Unhandled

Postby QmFyYiBSZWluaGFyZHQ » Mon, 16 Mar 2009 00:22:01 GMT

s it possible you're trying to overwrite an existing file and you're getting
an error from that?

"Karthizen" wrote:


RE: Exception from HRESULT: 0x800A03EC - COM Exception Unhandled

Postby S2FydGhpemVu » Mon, 16 Mar 2009 01:38:01 GMT

hank you Barb for your reply. Well, I tried to overwrite an existing file &
also tried to save it as a new file. However in both cases I was getting
that Exception. It would be wonderful if you could help me out to solve this
issue.
--
Regards,
Karthik


"Barb Reinhardt" wrote:


RE: Exception from HRESULT: 0x800A03EC - COM Exception Unhandled

Postby S2FydGhpemVu » Wed, 18 Mar 2009 06:54:01 GMT

ny one there to give a solution?
--
Regards,
Karthik


"Karthizen" wrote:


Similar Threads:

1.Error in excel com: Microsoft.Office.Interop.Excel Exception from HRESULT: 0x800A03EC

2.Exception from HRESULT: 0x800A03EC. with Excel Automation

Hi,
I know the question has been asked thousand times but I can't figure
out a solution with previous answers.

I'm getting a dataset as a query Result.
I just want to insert result in an Excel Range.
I already changed Thread Culture to fit the Excel one without result
I already know CopyFromRecordset does not work with Ado.Net Dataset
(without a lot of code) so, I convert my dataset to an object array.

But the code line where I set the Range value to the object array
failed with this damned error.

here is my code

oWorkSheet.Range(oExcel.ActiveCell.Address,
System.Reflection.Missing.Value).Resize(2, 1).Value(Type.Missing) =
DataArray

Please Help.
I know I missing paramater or doing some cast error.

If anybody has an idea, I thank him in advance.

3.WebBrowser hosts excel: Exception from HRESULT: 0x800A03EC

4."Exception from HRESULT: 0x800A03EC" - While saving excel file from VB.NET

Hi,

I have written a small tool for our internal purpose in VB.net. This tool
reads data from logs and saves it in an excel file. This tool is working fine
with MS Office 2000 but raising the following exception, when i run the tool
in a machine which contains MS Office 2003. 

Exception raised: "Exception from HRESULT: 0x800A03EC"

Note: Added "Microsoft Excel 11.0 Object Library" in the project reference.

Can anyone tell me what could be the problem ? If you need any other details,
please reply back.

Thanks in advance.

~ Sai

5.Exception from HRESULT: 0x800A03EC

6. Exception from HRESULT: 0x800A03EC at Excel.Workbooks.Open

7. Error: Exception from HRESULT: 0x800A03EC

8. Excel.Range.set_Value causing "Exception from HRESULT: 0x800A03EC"



Return to MS EXCEL

 

Who is online

Users browsing this forum: No registered users and 92 guest