What's the best way to read an xls-file? Is it possible to read specific cells?
Printable View
What's the best way to read an xls-file? Is it possible to read specific cells?
I've got some code that allows us to write to an Excel file, cell-by-cell. It seems to me that the reverse should be easy. It's a long piece of code; more than I want to post here. Send me your email addr and I'll shoot it out to you.
Add the Excel Object Library to the project references.
This should get you started in the right direction.Code:Sub GetCellValue()
Dim sVal as String
Workbooks.Open FileName:="C:\MyFile.XLS"
Workbooks.Application.Visible = True
sVal = Range("A1").Text
Workbooks.Application.Quit
Workbooks.Application.DisplayAlerts = False
End Sub
I also have created a form with Excel where I can bring up the form, fill in the blanks on the form and I have put a Command Button on the Excel form so that I can hit the button and email the filled out form to someone.
I need to know how to write the code for the command button, so when I push it, the filled in form gets mailed. (I don't want to save the filled in form as a file and then send because I have to continually use this form and email different information using the form).
Can anyone help...?
thanks