Discussion:
Exception from HRESULT: 0x800A03EC (Excel 2003 and C# )
(too old to reply)
Mike
2005-05-16 21:29:02 UTC
Permalink
Hi! I already posted this question but has gotten nowhere yet. I want to copy
one worksheet into another spreadsheet. Ron de Bruin from MS Excel
Programming
forum has suggested to use this code to achieve this:

Sub test()
Dim Wb1 As Workbook
Dim Wb2 As Workbook

Application.ScreenUpdating = False


Set Wb1 = Application.Workbooks.Open("C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test1.xls")

Set Wb1 = ActiveWorkbook
Set Wb2 = Application.Workbooks.Open("C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls")

Wb2.Sheets("Template").Copy After:=Wb1.Sheets(Wb1.Sheets.Count)

Wb2.Close False
Wb1.Save
Wb1.Close False

Set Wb2 = Nothing
Set Wb1 = Nothing

Application.ScreenUpdating = True

'clean up
End Sub

The code works great in VB-6. Here's my port in C#:


private void button1_Click(object sender, System.EventArgs e)
{
Excel.Workbook Wb1 = null;
Excel.Workbook Wb2 = null;
Excel.Worksheet Ws1 = null;

Excel.Application App1 = null;
Excel.Application App2 = null;

try
{

//App1 = new Excel.Application();
//App2 = new Excel.Application();

Type t1 = Type.GetTypeFromProgID("Excel.Application");
App1 = (Excel.Application) Activator.CreateInstance(t1);

Type t2 = Type.GetTypeFromProgID("Excel.Application");
App2 = (Excel.Application) Activator.CreateInstance(t2);


App1.ScreenUpdating = false;

Wb1 = App1.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test1.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

Wb1 = App1.ActiveWorkbook;

Wb2 = App2.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

Ws1 = (Excel.Worksheet) Wb2.Sheets.get_Item("Template");
// Bombs on this line:
Ws1.Copy(Type.Missing,Wb1.Sheets.get_Item(Wb1.Sheets.Count));

}
catch(Exception ex)
{
Debug.WriteLine(ex.ToString());
MessageBox.Show(ex.Message);
}
finally
{
Wb1.Save();
App1.ScreenUpdating = true;
App1.Quit();
App1 = null;

Wb2.Close(false,Type.Missing,Type.Missing);
App2.Quit();
App2 = null;

Application.Exit();
this.Close();


}

}

When I run this code it bombs with the following error:

'DefaultDomain': Loaded
'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'EXCEL_MERGER_DELETE_SOON': Loaded 'C:\Documents and Settings\conmxz\My
Documents\Visual Studio
Projects\EXCEL_MERGER_DELETE_SOON\EXCEL_MERGER_DELETE_SOON\bin\Debug\EXCEL_MERGER_DELETE_SOON.exe', Symbols loaded.
'EXCEL_MERGER_DELETE_SOON.exe': Loaded
'c:\winnt\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'EXCEL_MERGER_DELETE_SOON.exe': Loaded
'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No
symbols loaded.
'EXCEL_MERGER_DELETE_SOON.exe': Loaded
'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'EXCEL_MERGER_DELETE_SOON.exe': Loaded
'c:\winnt\assembly\gac\microsoft.office.interop.excel\11.0.0.0__71e9bce111e9429c\microsoft.office.interop.excel.dll', No symbols loaded.
'EXCEL_MERGER_DELETE_SOON.exe': Loaded
'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from
HRESULT: 0x800A03EC.
at Microsoft.Office.Interop.Excel._Worksheet.Copy(Object Before, Object
After)
at EXCEL_MERGER_DELETE_SOON.Form1.button1_Click(Object sender, EventArgs
e) in c:\documents and settings\conmxz\my documents\visual studio
projects\excel_merger_delete_soon\excel_merger_delete_soon\form1.cs:line 129


What am I doing wrong ? Is this a bug ? I googled a bit but did not find
anything usefull.

Any help is greatly appreciated.

Thank you in advance,
McLean Schofield [MSFT]
2005-05-17 17:17:49 UTC
Permalink
Hello,

I believe the exception is being thrown because your C# code is creating a
separate Excel.Application object to open each of the workbooks. Instead of
trying to copy a worksheet from a workbook opened in one Excel.Application
instance to a workbook opened in the other Excel.Application instance, you
can use a single Excel.Application instance to open both of the workbooks.

For the following snippet of code:

Wb2 = App2.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

After changing "App2" to "App1", your code works as expected.

Wb2 = App1.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

For Office development questions that are not specific to Visual Studio
Tools for the Microsoft Office System, you can also try the officedev forum
at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.office
dev&lang=en&cr=US


I hope this helps,
McLean Schofield
Programming Writer, Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Mike
2005-05-17 18:09:07 UTC
Permalink
G-d bless ! It works.

Thank you
Post by McLean Schofield [MSFT]
Hello,
I believe the exception is being thrown because your C# code is creating a
separate Excel.Application object to open each of the workbooks. Instead of
trying to copy a worksheet from a workbook opened in one Excel.Application
instance to a workbook opened in the other Excel.Application instance, you
can use a single Excel.Application instance to open both of the workbooks.
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);
After changing "App2" to "App1", your code works as expected.
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);
For Office development questions that are not specific to Visual Studio
Tools for the Microsoft Office System, you can also try the officedev forum
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.office
dev&lang=en&cr=US
I hope this helps,
McLean Schofield
Programming Writer, Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
guangqin lu
2006-05-12 16:32:34 UTC
Permalink
McLean,
I saw you sloved the issue below which is very similar to mine here now.
I tried all possible ways but no way out. Would you help me out.
Thank you in advance

Lucy Lu ( guangqin Lu)
my emial:
***@citigroup.com


This is my code of C#
-----------------------------------------------------
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Excel;

/// </summary>
class myExcel
{
public static int Main()
{
Excel.ApplicationClass exc = new Excel.ApplicationClass();

if (exc == null)
{
Console.WriteLine("ERROR: EXCEL couldn't be started!");
return 0;
}

exc.Visible = true;


/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//To create a workbook with sheets to work on and add more sheets
//////////////////////////////////////////////////////////////////////////////////////////////////////
_Workbook myworkbook = exc.Workbooks.Add(Type.Missing);
Sheets sheets = myworkbook.Worksheets;

_Worksheet worksheet1 = (_Worksheet) sheets.get_Item(1);
worksheet1.Name= "myjob1";

_Worksheet worksheet2 = (_Worksheet) sheets.get_Item(2);
worksheet2.Name="myjob2";

sheets.Add(worksheet1 ,worksheet2 ,5 ,XlSheetType.xlWorksheet); //This
line bombs

Console.WriteLine (sheets.Count);
return 100;
}


}
================================================
This is the error message
================================================
'System.Runtime.InteropServices.COMException' occurred.
Addtional information: Exception from HRESULT:0x800A03EC


The following is the reply you solved for the question put this link.
http://www.ureader.com/message/692318.aspx
==========================================================
Tue, 17 May 2005 17:17:49 GMT
content: Hello,

I believe the exception is being thrown because your C# code is creating a
separate Excel.Application object to open each of the workbooks. Instead of

trying to copy a worksheet from a workbook opened in one Excel.Application
instance to a workbook opened in the other Excel.Application instance, you
can use a single Excel.Application instance to open both of the workbooks.

For the following snippet of code:

Wb2 = App2.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

After changing "App2" to "App1", your code works as expected.

Wb2 = App1.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

For Office development questions that are not specific to Visual Studio
Tools for the Microsoft Office System, you can also try the officedev forum

at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.
office
dev&lang=en&cr=US


I hope this helps,
McLean Schofield
Programming Writer, Microsoft

=======================================================
McLean Schofield [MSFT]
2006-05-15 16:55:54 UTC
Permalink
Hello,

It looks like the main problem is that in the following line of code

sheets.Add(worksheet1 ,worksheet2 ,5 ,XlSheetType.xlWorksheet);

you are supplying values for both the 'Before' and 'After' parameters (the
first two parameters). This doesn't make sense to Excel, as you can only
add the new sheets before a specified sheet, or after a specified sheet,
but not both at the same time. You must pick one location for the new
sheets, and then pass System.Type.Missing to the other parameter. So, if
you want to add the new sheets before worksheet1, you could change your
code to:

sheets.Add(worksheet1, System.Type.Missing, 5,
Excel.XlSheetType.xlWorksheet);

Alternatively, if you want to add the new sheets after worksheet2, you
could change your code to:

sheets.Add(System.Type.Missing, worksheet2, 5,
Excel.XlSheetType.xlWorksheet);

If you want to accomplish both (in other words, add 5 new sheets before
worksheet1, and after worksheet2), then you have to make both of these
calls.

Also note that you should not be creating instances of
Microsoft.Office.Interop.Excel.ApplicationClass in your automation code.
Instead, you should create instances of
Microsoft.Office.Interop.Excel.Application. The former works in this case,
but it might cause problems in other code. The following blog entry by Eric
Carter provides further information about the primary interop assembly
(PIA) object model and why you should use
Microsoft.Office.Interop.Excel.Application instead of
Microsoft.Office.Interop.Excel.ApplicationClass:
http://blogs.msdn.com/eric_carter/archive/2004/05/06/127698.aspx

For for further questions such as this that are not specific to Visual
Studio Tools for the Microsoft Office System, please use the officedev
forum at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.office
dev&lang=en&cr=US

I hope this helps,

McLean Schofield

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
guangqin lu
2006-05-17 13:33:39 UTC
Permalink
McLean
Thank you.
It worked as you indicated here. Thanks for you. It makes me feel so
good.
Thank you again
Lucy Lu
david lee
2006-07-14 15:39:26 UTC
Permalink
Hi, could someone please help me with my problem?

I am exporting data to excel using the COM object. I got the same error
message (Exception from HRESULT: 0x800A03EC) when exporting text. Does
anyone know if there's any special characters that will generate this
exception when exporting to excel?
Harry Miller [MSFT]
2006-07-17 15:22:54 UTC
Permalink
That looks like the Excel globalization issue. Have a look at this article
and see if it applies to your situation:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2005_ta/html/OfficeVSTOGlobalization.asp
--
Harry Miller
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by david lee
Hi, could someone please help me with my problem?
I am exporting data to excel using the COM object. I got the same error
message (Exception from HRESULT: 0x800A03EC) when exporting text. Does
anyone know if there's any special characters that will generate this
exception when exporting to excel?
didi
2007-09-24 09:39:05 UTC
Permalink
Hi McLean ,

I hope you can help me.
i work on asp 1.1 and i try to create excel document and to fill it with
some data.
i add to my project Microsoft Excel 11.0 Object Library,
Just the only library that i found.
i have this exception when i try to put data into a cell.
Here is my code:

/*************start code ******************************
Dim RetVal As String
Try
Dim app As Excel.Application
Dim exbook As Excel._Workbook
Dim exsheet As Excel._Worksheet
Dim t1 As Type = Type.GetTypeFromProgID("Excel.Application")
Dim tt As XmlElement
Dim columnTitle As String
Dim ColTitel() As String
Dim colCount As Integer
columnTitle = ExcelContent.SelectSingleNode("child::columnTitle")
.InnerText
' colTitle = objXML.documentElement.
selectSingleNode("//columnTitle").text;
'alert(colTitle);
ExcelString = columnTitle
colCount = columnTitle.Split("|").Length - 1
ColTitel = columnTitle.Split("|")
app = CType(Activator.CreateInstance(t1), Excel.Application)

exbook = app.Workbooks.Add(Missing.Value)
exsheet = CType(exbook.ActiveSheet, Excel._Worksheet)
Dim xx, j As Integer

For xx = 0 To colCount
exsheet.Cells(xx, 1) = "sdfsd" ' ColTitel(xx).ToString()
Next
exbook.SaveAs(GetFileName())
exbook.Close(False, Type.Missing, Type.Missing)
app.Quit()
app = Nothing
'app.Quit()
'app.Visible = True
Catch ex As Exception

End Try

/*********************end code ****************************

Maby can someone to help me with this ishue.

Thanks A lot
Didi
Helmut Obertanner
2007-10-18 18:52:06 UTC
Permalink
Hello did,

as I know all collections in Office are starting from 1, not 0

For xx = 1 To colCount
exsheet.Cells(xx, 1) = "sdfsd" ' ColTitel(xx).ToString()
Next

Hope this helps,
greets, Helmut
Post by didi
Hi McLean ,
I hope you can help me.
i work on asp 1.1 and i try to create excel document and to fill it with
some data.
i add to my project Microsoft Excel 11.0 Object Library,
Just the only library that i found.
i have this exception when i try to put data into a cell.
/*************start code ******************************
Dim RetVal As String
Try
Dim app As Excel.Application
Dim exbook As Excel._Workbook
Dim exsheet As Excel._Worksheet
Dim t1 As Type = Type.GetTypeFromProgID("Excel.Application")
Dim tt As XmlElement
Dim columnTitle As String
Dim ColTitel() As String
Dim colCount As Integer
columnTitle =
ExcelContent.SelectSingleNode("child::columnTitle")
.InnerText
' colTitle = objXML.documentElement.
selectSingleNode("//columnTitle").text;
'alert(colTitle);
ExcelString = columnTitle
colCount = columnTitle.Split("|").Length - 1
ColTitel = columnTitle.Split("|")
app = CType(Activator.CreateInstance(t1), Excel.Application)
exbook = app.Workbooks.Add(Missing.Value)
exsheet = CType(exbook.ActiveSheet, Excel._Worksheet)
Dim xx, j As Integer
For xx = 0 To colCount
exsheet.Cells(xx, 1) = "sdfsd" ' ColTitel(xx).ToString()
Next
exbook.SaveAs(GetFileName())
exbook.Close(False, Type.Missing, Type.Missing)
app.Quit()
app = Nothing
'app.Quit()
'app.Visible = True
Catch ex As Exception
End Try
/*********************end code ****************************
Maby can someone to help me with this ishue.
Thanks A lot
Didi
Shane Sanders
2009-04-20 16:28:50 UTC
Permalink
I am getting this error on a saveas running Server 2008. I do not get it
running Server 2003, or if I am logged into Server 2008 in a DOS window. I
get it when kicked off from a website using Network Service at the user.

workbook.SaveAs(fileName, XlFileFormat.xlWorkbookNormal, Type.Missing, Type.
Missing, false, false, XlSaveAsAccessMode.xlShared,
XlSaveConflictResolution.xlLocalSessionChanges, false, Type.Missing, Type.
Missing, Type.Missing);

I am not having much luck googleing. Any Help would be appreciated.

url:http://www.ureader.com/msg/1543132.aspx
guangqin lu
2006-05-12 16:46:17 UTC
Permalink
McLean,
I saw you sloved the issue below which is very similar to mine here now.
I tried all possible ways but no way out. Would you help me out.
Thank you in advance

Lucy Lu ( guangqin Lu)
my emial:
***@citigroup.com


This is my code of C#
-----------------------------------------------------
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Excel;

/// </summary>
class myExcel
{
public static int Main()
{
Excel.ApplicationClass exc = new Excel.ApplicationClass();

if (exc == null)
{
Console.WriteLine("ERROR: EXCEL couldn't be started!");
return 0;
}

exc.Visible = true;


/////////////////////////////////////////////////////////////////////////////////////////////////////
//
//To create a workbook with sheets to work on and add more sheets
//////////////////////////////////////////////////////////////////////////////////////////////////////
_Workbook myworkbook = exc.Workbooks.Add(Type.Missing);
Sheets sheets = myworkbook.Worksheets;

_Worksheet worksheet1 = (_Worksheet) sheets.get_Item(1);
worksheet1.Name= "myjob1";

_Worksheet worksheet2 = (_Worksheet) sheets.get_Item(2);
worksheet2.Name="myjob2";

sheets.Add(worksheet1 ,worksheet2 ,5 ,XlSheetType.xlWorksheet); //This
line bombs

Console.WriteLine (sheets.Count);
return 100;
}


}
================================================
This is the error message
================================================
'System.Runtime.InteropServices.COMException' occurred.
Addtional information: Exception from HRESULT:0x800A03EC


The following is the reply you solved for the question put this link.
http://www.ureader.com/message/692318.aspx
==========================================================
Tue, 17 May 2005 17:17:49 GMT
content: Hello,

I believe the exception is being thrown because your C# code is creating a
separate Excel.Application object to open each of the workbooks. Instead of

trying to copy a worksheet from a workbook opened in one Excel.Application
instance to a workbook opened in the other Excel.Application instance, you
can use a single Excel.Application instance to open both of the workbooks.

For the following snippet of code:

Wb2 = App2.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

After changing "App2" to "App1", your code works as expected.

Wb2 = App1.Workbooks.Open(@"C:\Documents and
Settings\conmxz\Desktop\EXCEL_MERGE\test2.xls",
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

For Office development questions that are not specific to Visual Studio
Tools for the Microsoft Office System, you can also try the officedev forum

at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.
office
dev&lang=en&cr=US


I hope this helps,
McLean Schofield
Programming Writer, Microsoft

=======================================================
McLean Schofield [MSFT]
2006-05-15 15:53:46 UTC
Permalink
Hello,

It looks like the main problem is that in the following line of code

sheets.Add(worksheet1 ,worksheet2 ,5 ,XlSheetType.xlWorksheet);

you are supplying values for both the 'Before' and 'After' parameters (the
first two parameters). This doesn't make sense to Excel, as you can only
add the new sheets before a specified sheet, or after a specified sheet,
but not both at the same time. You must pick one location for the new
sheets, and then pass System.Type.Missing to the other parameter. So, if
you want to add the new sheets before worksheet1, you could change your
code to:

sheets.Add(worksheet1, System.Type.Missing, 5,
Excel.XlSheetType.xlWorksheet);

Alternatively, if you want to add the new sheets after worksheet2, you
could change your code to:

sheets.Add(System.Type.Missing, worksheet2, 5,
Excel.XlSheetType.xlWorksheet);

If you want to accomplish both (in other words, add 5 new sheets before
worksheet1, and after worksheet2), then you have to make both of these
calls.

Also note that you should not be creating instances of
Microsoft.Office.Interop.Excel.ApplicationClass in your automation code.
Instead, you should create instances of
Microsoft.Office.Interop.Excel.Application. The former works in this case,
but it might cause problems in other code. The following blog entry by Eric
Carter provides further information about the primary interop assembly
(PIA) object model and why you should use
Microsoft.Office.Interop.Excel.Application instead of
Microsoft.Office.Interop.Excel.ApplicationClass:
http://blogs.msdn.com/eric_carter/archive/2004/05/06/127698.aspx

For for further questions such as this that are not specific to Visual
Studio
Tools for the Microsoft Office System, please use the officedev forum at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.office
dev&lang=en&cr=US

I hope this helps,

McLean Schofield

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
guangqin lu
2006-05-17 12:59:31 UTC
Permalink
McLean,
Thanks for your help. I am going to try it according to what you
told me here. I sent you several mails as I wanted you to help me.
Actually, I made my code work with templete as a solution for the
issue I put here.
But I do appreciate your help very much. I also asked a consultant
in our group from Microsoft to put this issue in your intranet.
Thanks a lot.
Lucy
Srinivas Endra
2009-06-04 11:09:39 UTC
Permalink
Hi, I have same problem like the following one, but my problem is while
executing the code in VC++.
I have been trying to embed the image. here is the syntax that I am using.

_variant_t varProgID = _bstr_t("WorkSpace");
_variant_t varPath = vtMissing;
_variant_t varLink(VARIANT_FALSE, VT_BOOL);
_variant_t varDisplayAsIcon(VARIANT_FALSE, VT_BOOL);

Excel::_OLEObjectPtr spOleObject = spOleObjects->Add(
&varProgID, // ProgID
&varPath, //, // FileName
&varLink, // Link
&varDisplayAsIcon, //DisplayAsIcon
10.0F, 10.0F, 400.0F, 150.0F
);
I cought this error and it is throwing 0x800A03EC.
I am using MS office 2007.

url:http://www.ureader.com/msg/1543132.aspx
Srinivas Endra
2009-06-04 11:09:39 UTC
Permalink
Hi, I have same problem like the following one, but my problem is while
executing the code in VC++.
I have been trying to embed the image. here is the syntax that I am using.

_variant_t varProgID = _bstr_t("WorkSpace");
_variant_t varPath = vtMissing;
_variant_t varLink(VARIANT_FALSE, VT_BOOL);
_variant_t varDisplayAsIcon(VARIANT_FALSE, VT_BOOL);

Excel::_OLEObjectPtr spOleObject = spOleObjects->Add(
&varProgID, // ProgID
&varPath, //, // FileName
&varLink, // Link
&varDisplayAsIcon, //DisplayAsIcon
10.0F, 10.0F, 400.0F, 150.0F
);
I cought this error and it is throwing 0x800A03EC.
I am using MS office 2007.

url:http://www.ureader.com/msg/1543132.aspx
Athiappan
2009-09-29 15:06:23 UTC
Permalink
hai
am also getting the same error while executing the macro code from excel
2003.
//added the dll to the macro through the following code
m_objBook.VBProject.References.AddFromFile("");

//got the error here where macroSample is the name of the module
m_objExcel.Run("macroSample", m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,m_objOpt,
m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt, m_objOpt,m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt);

// this works fine in office 2007. can anyone help me in this issue. am
fighting with this for days

url:http://www.ureader.com/msg/1543132.aspx

Loading...