open, change a excel document from word
hi,
i want to get some info out of a excel document into Word.
I have found the next code on the internet:
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Open("C:\Foldername\Filename.xls")
With xlWB.Worksheets(1)
end with
xlWB.Close False
xlApp.Quit
only when i run the procedure i get the next compile error:
user - defined type not defined
on the line : Dim xlWB As Excel.Workbook
how can i prevent this?
|