Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Automation from Access

I have data from an outside text file that I'm linking to in Access. I'm
then using the Access VBA to create an Excel workbook (I was going to try to
use TransferSpreadsheet, but the format and cell placement was too tricky).
The problem is that when I try to set the Formula property from Access, it
doesn't work. It just copies it as a string. I posted this in the Access
Programming as well, but since I'm doing it from Access, it gets a bit
complicated and I'm not sure exactly where it fits.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Automation from Access


Hi Sam,

Copy the following VB code into a module in MS Access. It will creat
an instance of Excel, create a new workbook and insert a simple formul
into cell A1 of the new workbook:


Code
-------------------
Sub AccessToExcel()
Dim xlApp As Object

' Start Excel application...
Set xlApp = CreateObject("Excel.Application")
' Make Excel visible to user...
xlApp.Application.Visible = True
' Open new Excel workbook...
xlApp.Workbooks.Add
' Set relevant worksheet in workbook
xlApp.ActiveWorkbook.Worksheets(1).Activate
' Select cell in workbook
xlApp.ActiveSheet.Range("A1").Select
' Insert formula into active cell...
xlApp.ActiveCell.Formula = "=B1+C1"

End Su
-------------------


Hope this helps,
theDud

--
theDud
-----------------------------------------------------------------------
theDude's Profile: http://www.excelforum.com/member.php...fo&userid=1655
View this thread: http://www.excelforum.com/showthread.php?threadid=49405

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation to Excel from Access Bob Barnes Excel Discussion (Misc queries) 1 February 11th 08 05:18 AM
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
Access Automation to Excel Bob Barnes[_3_] Excel Programming 0 January 15th 04 01:47 AM
Access automation from Excel AccessChallenged Excel Programming 2 December 31st 03 06:29 PM
Automation Excel & Access GarethG Excel Programming 6 October 3rd 03 09:14 AM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"