Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Office web components 11 in vb 2005

Status
Not open for further replies.

SeaweedOPM

Technical User
Nov 19, 2004
53
US
Please i have spent all day trying to find out how to select a different sheet. I can do anything with a cell


AxSpreadsheet1.Cells(6,3) = 345.43
AxSpreadsheet1.Cells(4,2) = texbox1.Text


Everything with the current sheet is perfect but aside from the fact it places info into whatever the active sheet is.

I've tried these with no luck:

AxSpreadsheet1.Sheets(2).Select
AxSpreadsheet1.Sheets(2).Cells(3,5) = 34
AxSpreadsheet1.WorkSheets(3).Select
AxSpreadsheet1.WorkSheets(3).Cells(4,2) = 432
AxSpreadsheet1.Item(3).Select

and so on...
please let me know, I have a 6 sheet excel file with tons of formulas that imports beautifully.

AxSpreadsheet1.Worksheets.Count 'Even works!
 
If anyone was wondering how, I found out right after posting. I'm not sure what my problem was. Well here are a few examples (I made a few adjustments):

Dim wbk1 As Object, wbk2 As Object, wbk3 As Object

wbk1 = AxSpreadsheet1.Worksheets(1)
wbk2 = AxSpreadsheet1.Worksheets(2)
wbk3 = AxSpreadsheet1.Worksheets(3)

wbk1.Range("A2").Value = tbS2C7.Text
wbk2.Range("B3").Value = tbs2c8.Text
AxSpreadsheet1.Worksheets(3).Range("B3").Value = 123


Cells will work too
AxSpreadsheet1.Worksheets(2).Cells(3,4) = tbS2C34.Text



Use your imagination. Next though I'd like to export my final cells after formula calcs into a database. Will see if i know enough to get myself through it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top