[AccessD] Excel Code

Philippe PONS Philippe.Pons19 at wanadoo.fr
Mon Aug 4 14:17:20 CDT 2003


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
>




More information about the AccessD mailing list