Offic Automation Help

NickJ

Member
Joined
Apr 29, 2005
Messages
21
Programming Experience
Beginner
Hi guys

Ok what i need to do is get excel cell information at runtime.

On form1 I have a button that at runtime creates tabpages based on a selected number from a combobox. On form2 each tabpage that has been created has a number of Labels that will display the information.

I have the code to create the tapbage and labels, but im stuck as to how to read the information on the new tabpages once they have been created on form2

Ive written the code for the excel sheet
VB.NET:
   [COLOR=blue][FONT=&quot]Dim[/FONT][/COLOR][FONT=&quot] MyXl [COLOR=blue]As[/COLOR] Excel.Application = [COLOR=blue]New[/COLOR] Excel.Application[/FONT]
   [FONT=&quot]    [COLOR=blue]Dim[/COLOR] MyBook [COLOR=blue]As[/COLOR] Excel.Workbook[/FONT]
   [FONT=&quot]    [COLOR=blue]Dim[/COLOR] MySheet [COLOR=blue]As[/COLOR] Excel.Worksheet[/FONT]
 
 
   [FONT=&quot]Label1.Text = MyXl.Range("B6").Text[/FONT]
   [FONT=&quot][/FONT]

When I run the program I get this error

Exception from HRESULT: 0x800A03EC.


Any ideas what this error means?

Thanks

Nick
 
Back
Top