I've written several VBA applications in AutoCAD 2000. We currently have 18 people at various locations around the world using them. One of our sites in Asia recently added a design group and they have purchased AutoCAD 2002. One of the applications that scans a drawing, extracts information, and generates a report in Excel has been working fine with 2000 for the past couple of years but generates the following error when run on the machine with 2002 installed: Run-time error 424: Object required Here's the line of code that the debugger stops on: ' Define the table range. Set Table = Excel.ActiveSheet.Range("A15").Resize _ (UBound(Report, 1), UBound(Report, 2)) ' Copy the array to the range. Table = Report ' <------- Error occurs here Table.HorizontalAlignment = xlCenter Table.VerticalAlignment = xlCenter Table.WrapText = False Does anybody have any idea what is causing the error? I can't duplicate it on AutoCAD 2000 and I don't have a copy of AutoCAD 2002 to work with. Note: The program works with Excel 97, Excel 2000, and Excel XP from AutoCAD 2000 so it appears the problem is with AutoCAD 2002.
Thanks for the idea James. I'm at a loss as to what to try. I'll make the change and send it to the designer overseas tonight and see if that works. Mark
2000 is vb5-based while 2002 is vb6-based. Typically I have only seen errors going backward but you may be doing something that was removed from vb earlier in your code than what you posted here. ___________________________ Mike Tuersley AutoCAD Clinic Rand IMAGINiT Technologies
What is Table dimensioned as? Is the lower bound of the array dimensioned to be 1 or 0? Have you done a Debug.Print of the info you extract and its types, before you try to add it to Excel, to see that it's valid? Maybe something about the extracted data changed between ACAD versions... If you're not already using ScreenUpdatating, using it will speed up your loop a lot. Excel.screenupdating = false ' or Excel.Application.... ' do your loop to fill range Application.ScreenUpdating = true Just make sure the code in the loop is simple and bulletproof, because if the program bombs out ScreenUpdating is not turned back on automatically. James