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
Text for Textbox, what for Combobox?
Hi Guys and Gals
I know that I can use .text for a text box to take through to Excel. What can I use to take the text thats in a Combobox through to Excel?
Below is what I am using
objExcel.Cells(23, 9).Value = txtLast10.Text
objExcel.Cells(5, 10).Value = cboDept1.????
Thanks once again