LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic VSTO questions

I am an absolute beginner with VSTO and Excel. I am using VS 2008 Express.
I've been able to execute a few very basic steps by creating a reference to
the Microsoft Excel 12.0 Object Library COM object. That allowed me to start
an Excel app and at least view the workbook object. My question is this. I
want to do some basic cell operations. It seems that I do not understand the
Excel object model. I assumed that if I created the Excel App, then I would
be able to access the sub-ordinate Workbooks collection and then the
Worksheets collection and eventually the cells on the worksheet, but it
hasn't worked.

Here's my code:

Excel.Application myApp = new Excel.Application();
myApp.Visible = true;
myApp.StatusBar = "Hello World";

//This line loads a workbook from an existing csv file
", missing, false,
missing, missing, missing, missing, missing, ",", true, missing, missing,
true, missing, missing);
//This line allows me to see the name of the workbook
string name = myApp.Workbooks[1].Name;

Then I would think that I could access the worksheet inside the workbook
with something like this, but it does not work:
string name2 = myApp.Worksbooks[1].WorkSheets[1].Name
Do I need to create a worksheet? I can see the open Excel application and
the three default worksheets are there.

Please someone, help me understand the proper way to access the worksheet
and then the cells on it. It seems there is very little information on the
web that provides good examples of this. Help!

riversr

 
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
Some basic VBA questions [email protected] Excel Programming 8 January 17th 09 01:29 AM
Very basic VBA questions. Cerberus Excel Programming 5 July 21st 08 07:43 PM
Newbie to VSTO basic question about what to buy Don Excel Programming 2 May 11th 08 03:01 AM
Basic Questions Peter Excel Programming 5 July 1st 07 07:32 PM
Basic questions Maine begins Excel Discussion (Misc queries) 1 July 7th 06 06:45 PM


All times are GMT +1. The time now is 04:16 AM.

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

About Us

"It's about Microsoft Excel"