Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help setting formula and values of a cell

Hi all, I'm attempting to automate production of an excel worksheet with a
displayed text value, and a hyperlinked address. I'm using the following code:

for (int i = 0; i < printstrings.Length; i++)
{
Excel.Range cell =
(Excel.Range)currentworksheet.Cells[currentlinenumber, i + 1];
cell.Formula = "=HYPERLINK(\"" + hyperlinks[i] + "\")";
cell.Value2 = printstrings[i];
}
currentlinenumber++;

This executes successfully in debug mode on my development machine, but when
I test the application on other machines, I get the error:

System.Runtime.InteropServices.COMException (0x800A03EC):

Exception from HRESULT: 0x800A03EC at
System.RuntimeType.ForwardCallToInvokeMember(Strin g

memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes,

MessageData& msgData) at
Microsoft.Office.Interop.Excel.Range.set_Formula(O bject )



Any ideas on what to do to resolve this? Thanks in advance!
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
Setting values in a cell Stephen Excel Discussion (Misc queries) 3 July 10th 08 08:23 PM
Setting Cell Values??? Music Junkie Excel Programming 2 June 30th 08 03:17 AM
Setting range for the VALUES obtained from formula Thulasiram[_2_] Excel Programming 4 January 14th 07 06:20 PM
Setting Cell Values from VBA Casteele/ShadowLord Excel Programming 1 December 20th 06 12:10 AM
Need Help Setting Cell Values Jay Excel Programming 1 September 29th 05 04:09 PM


All times are GMT +1. The time now is 03:48 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"