Bob Heygood
bheygood at abestsystems.com
Mon Aug 4 14:35:35 CDT 2003
Hey Philippe, Wow I thought I did but sure enough I removed it to accommodate a user that has a different version of Excel. Still would love for an Excel guru to help me make the code work. Thanks, Bob -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Philippe PONS Sent: Monday, August 04, 2003 12:17 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Excel Code Hi Bob, If you can't gain access to the Excel object model from Access, it is because you did not declare a reference to the Excel library from Tool/References... Do it, and you will get it! Regards, Philippe. ----- Original Message ----- From: "Bob Heygood" <bheygood at abestsystems.com> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Monday, August 04, 2003 9:10 PM Subject: [AccessD] Excel Code > Hey to the Group, > > I have found some great code to go to an excel sheet and total a column. It > works in excel fine. But when I try and adapt it to automate excel from > Access, I get errors for the "Cells(xxxx)" object. I have been successful in > instancing the Excel application and the Excel workbook. I have tried to > understand the cell thing but cannot get the Excel object model to show up > in the object browser in Access. > > So, how do I get this to work in Access. And, how can one explore the excel > model from Access. > > Code: > > Dim cRows As Long > > cRows = Cells(Rows.Count,"A").End(xlUp).Row > Cells(cRows+1,"A").FormulaR1C1 = "=SUM(R1C1:R[-1]C1)" > > This is for column A, change the "A" and C1 if a different column required. > > Code End: > > TIA > > Bob > > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com