|
-
Feb 15th, 2001, 09:13 AM
#1
Thread Starter
Hyperactive Member
Gaffer , thanks for your suggestion , I think that will work and I have tried out some small trials and all seems to be working.
Private Sub Command1_Click()
Dim spreadsheetname As String
Dim objXLS As New Excel.Application
spreadsheetname = "c:\funnys\book2.xls"
With objXLS
.Workbooks.Open spreadsheetname
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("f1").Select
ActiveCell.FormulaR1C1 = "xxx"
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("f1").Select
ActiveCell.FormulaR1C1 = "xxx"
ActiveWorkbook.Save
End With
Set objXLS = Nothing
MsgBox "finito"
End Sub
what I need to know is if the excel workbook has several sheets inside it , how do I name the sheet I want to use. In the example I have above I just name the workbook to open ie book2 but how do I tell it to open book2 and work with sheet 3 inside the work book.
thx for any help
Locutus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|