View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default Office Web Component Spreadsheet: C#

I can use the OWC.Spreadsheet component successfully from VB6. From C#, I cannot figure out how to activate another worksheet. The (working) code for the default active sheet is:

axSpreadsheet1.ActiveSheet.ConnectionString="Drive r={Oracle in OraHome9};Server=D2K1Z01J;Database=HR;UID=AA;PWD=O RACLE";

axSpreadsheet1.ActiveSheet.CommandText="Select * from hr.employees;";

I want to be able to do this:

axSpreadsheet1.Worksheets[2].ConnectionString= ....
axSpreadsheet1.Worksheetd[2].CommandText= ....

This works in VB6: I get all kind of errors in C#. I have searched the WEB for a solution and posted the query in the C# newsgroup a few days ago: no joy at all.

Can someone show me the way? Please.