DDE between Access and Excel

  • Thread starter Thread starter wjessen
  • Start date Start date
W

wjessen

Guest
I am trying to populate an Excel Spread sheet from an Access table. I have been able to open the Spread sheet and populate the data. However, I have not been able to save the sheet after it is populated. In addition I have not been able to terminate Excel within the subroutine.

The following command works:
DDEExecute Chan, "[CLOSE]"
This saves the worksheet, but doesn't terminate Excel. I have tried
DDEExecute Chan, "[Exit]" - Doesnt work.
 
Hey wjessen,

much more comfortable but a bit more work to programme is doing like this:

Dim oXL as Excel.Application

set oXL=createObject("Excel.Application")
oXL.Worksheets.Add.....

For this you only need to make a reference to Microsoft Excel in "References" (available in any code-area).
After having set oXL you've got full control to Excel - including:

oXL.Quit
set oXL=nothing

Mic
 

Users who are viewing this thread

Back
Top Bottom