excel automation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top