|
-
Sep 14th, 2001, 11:04 AM
#1
Thread Starter
Lively Member
Text box info from vb to Excel
Ok this is my problem, I have a program that calculates costs and displays the costs in 3 text boxes. I need to be able for VB to open a new excel sheet and put the info from the text boxes in to the cells.
This is the code I have:
Dim x1app As Excel.Application
Dim x1book As Excel.Workbook
Dim x1sheet As Excel.Worksheet
Set x1app = New Excel.Application
Set x1book = x1app.Workbooks.Add
Set x1sheet = x1book.Worksheets.Add
x1sheet.Cells(1, 1).Value = Text1.Text
x1sheet.Cells(2, 1).Value = Text2.Text
x1sheet.Cells(3, 1).Formula = "r1c1 +r2c1"
Text3.Text = x1sheet.Cells(3, 1)
But when I run it I get an error saying: Invalid use of new key word and the line
Set x1app = New Excel.Application is highlighted.
Please can some one help
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
|