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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel.Application

Status
Not open for further replies.

jode

Programmer
Aug 14, 2001
21
GB
Please help me the following code does not work for me and I have been out of coding for a while and getting very frustrated

Dim appExcel As Excel.Application
Dim wbk As Excel.Workbook
Dim wks As Excel.Worksheet

If I create a new object then I cannot work out how to reference the workbook / worksheets....

I am sure it is something as simple as a missing reference

 
It probably is.

Go to Tools->References and make sure

Microsoft Excel x.x Object Library

is checked.

 
A starting point:
Set appExcel = CreateObject("Excel.Application")
Set wbk = appExcel.Workbooks.Open("\path\to\spreadsheet.xls")
Set wks = appExcel.ActiveSheet

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top