Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel returns hresult 0x800A03EC at inserting Hyperlinks (C#)

Hi!

I have a C# App which creates a Excel Sheet where Hyperlinks are
included.

If i create the file the first time or create a new Sheet it runs
without problems. But if i open the existing Sheet or add a new one and
try to append the new items to the existing items i get the hresult
error message. I reproduced the problem down to the call where i add the
hyperlinks to the sheet.

Here is the code-fragment:

Here i open the Excel App and open the Workbook and Worksheet!

Excel.ApplicationClass excelApp = new Excel.ApplicationClass();
excelApp.Visible = false;

Excel.Workbook newWorkbook newWorkbook = excelApp.Workbooks.Open
(ReportFile, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

Excel.Sheets sheets = newWorkbook.Worksheets;
Excel._Worksheet workSheet = (Excel._Worksheet)sheets.get_Item
(sheets.Count);


After that i run through the items i want to add. If i remove the
Hyperlink.Add call the items are added and everythink works fine.
intExcelRow is the Line where i want to add the new item.

Excel.Range itemRange = workSheet.get_Range("A" + intExcelRow.ToString
(), "AQ" + intExcelRow.ToString());

object[] objItem = new Object[1];
objItem[0] = excelItem;
itemRange.GetType().InvokeMember("Value",
System.Reflection.BindingFlags.SetProperty, null, itemRange, objItem);

workSheet.Hyperlinks.Add((Excel.Range)itemRange.Ce lls[1, 2],
"http://www.google.de/", Type.Missing, Type.Missing,
"http://www.google.de/");


I changed the Call to

workSheet.Hyperlinks.Add(workSheet.get_Range("B" + intExcelRow.ToString
(), Type.Missing), "http://www.google.de/", Type.Missing, Type.Missing,
"http://www.google.de/")

without any luck


Any help would be great


Matthias
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting carriage returns in Excel cells Alyce Excel Discussion (Misc queries) 5 September 13th 06 03:46 PM
Exception from HRESULT: 0x800A03EC nano2k New Users to Excel 0 July 21st 06 12:15 PM
How can I prevent Excel 2000 from inserting hyperlinks? RJL Jr. Setting up and Configuration of Excel 1 May 20th 05 12:15 PM
0x800A03EC, asp and excel export RobertG[_2_] Excel Programming 0 October 1st 04 01:29 PM
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. Steven Excel Programming 1 November 5th 03 06:59 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"