Reputation: 65
I am working with access 2010 and writing so VBA code. My problem is that when I write the object name and a dot, the method list for this kind of object does not appear. With other types of objects such as recordset is fine. I believe the problem is that I do not declare the objects, but just set them as follows:
Set ExcelFile = CreateObject("Excel.Application")
Set Wbook = ExcelFile.Workbooks.Add
Set Wsheet = Wbook.Worksheets.Add
and the following do not work
Dim ExcelFile As Microsoft.Office.Interop.Excel
or
Dim ExcelFile As Microsoft.Office.Interop.Excel.Application
or
Dim ExcelFile As Object
and
Dim Wsheet1 As Worksheet
does not recognize Worksheet
The code works fine, is just that I would like to see the methods list while coding... Thanks!
Upvotes: 0
Views: 1029
Reputation: 348
You have to add the Excel Object Library to the references in VBA. Tools -> References, and look for Microsoft Excel XX.X Object Library. Then the declarations (and IntelliSense) should work.
Upvotes: 1