excel automation

R

RAHokie

I have successfully executed a TransferSpreadsheet command from Access. Now
I want to calculate the sum of the column and display it at the end of the
column. Suggestions needed re: locate the cell in which to place the sum
function & entering the sum function.
 
D

David Lloyd

There are a number of approaches to accomplishing this task. One is use the
CurrentRegion property, or another method outlined in the following KB
article to identify the cell row. If you have a fixed query, then the
column should be know ahead of time.

http://support.microsoft.com/default.aspx?scid=kb;en-us;291308

A second approach would be to create a macro in Excel and call the Excel
macro from Access after the export using the Application.Run command of the
workbook object. For example:

wkb.Application.Run "MyMacro", [Parameter1], ...

A third option, depending on your exact needs, would be to calculate the
totals with an Access Query and use a Union query to add to total data to
the bottom of the query. In that way, the totals are already in the
workbook.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have successfully executed a TransferSpreadsheet command from Access. Now
I want to calculate the sum of the column and display it at the end of the
column. Suggestions needed re: locate the cell in which to place the sum
function & entering the sum function.
 
Top