Exporting From Access Advice Please

G

Guest

I have some excel spreadsheets which are layed out as forms.
There are certain cells within each from where the data varies.

If I create an Access Database to store all my data ...

Is it possible to export data from Access 2003 into the appropriate cells on
my excel form?

Any advice and links would be much appreciated.
Thanks
Dermot
 
J

John Nurick

Hi Dermot,

It's possible; you need to write VBA code to automate Excel. It's best
to use Excel's Named Ranges to name each cell. Then you can do stuff
like this after setting a reference to the Microsoft Excel X.X Object
Library:

Dim oWbk As Excel.Workbook

Set oWbk = GetObject("C:\Folder\File.xls")

With oWbk
'Assign value of textbox txtXXX on current form to named cell XXX
.Names("XXX").RefersToRange.Formula = Me.txtXXX.Value
End With

oWbk.Close True 'save and close
Set oWbk = Nothing
 

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

Top