Re: Access to Excel



Hi Steve,

Naming fields with words that are also the names of common functions or
properties sooner or later causes problems, so don't use "Name" as a
name. Use something else, e.g. PartName.

The general idea is

1) set a reference to the Microsoft Excel Object Library

2) Then use VBA code along these lines (this is untested air code):

Dim oBook As Excel.Workbook
Dim strPartName As String

Set oBook = GetObject("D:\Folder\File.xls")

'need to add a criterion to the next line to specify the record
strPartName = DLookup("PartName", "MyTable", ???)

oBook.Names("PartName").Value = strPartName

oBook.Close True


On Fri, 16 Feb 2007 21:07:22 -0800, Steve.M
<SteveM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Basically I want to type a name in an access table/field titled name. I want
the name to simply be inserted in a cell named name in excel. I want that
done on 3 excel forms.

The excel forms are just report forms with a description part number etc. no
calculations or special features, just type and save.

Everything I have read seems to say that I can, but how? Please help.

--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.
.



Relevant Pages

  • Re: Access to Excel
    ... John I really apreciate your feed back. ... Dim oBook As Excel.Workbook ... Dim strPartName As String ... the name to simply be inserted in a cell named name in excel. ...
    (microsoft.public.access.externaldata)
  • RE: ALL EXPERTS ........... WHERE ARE YOU ??
    ... that if someone sees MVP next to a name in a reply that they may assume I ... MVP or otherwise really sharp Excel person, I figure things are in good hands. ... VBA code is set aside and the file opens. ... I would like to know whether this is not possible or there is a bug in the ...
    (microsoft.public.excel.misc)
  • ActiveX Control Events dropped | lost | blocked - Excel / VBA
    ... I'm trying to track down any info on when VBA code gets halted and/or ... EVERY event fired by the ActiveX control. ... gets "sunk" by Excel VBA code. ... events ARE dropped whenever you type into a cell or the formula ...
    (microsoft.public.excel.programming)
  • Re: Excel 2007, log chart issue
    ... I manually set the scale to logarithmic, I got the error the first time, but ... I was using Excel 2007 SP1, ... Also I have found that under some circumstances with a log axis just *reading* Axes.MaximumScale in VBA can also cause the error message to occur again. ... It also fails to show all the legends correctly when a large number of data lines are plotted in the initial graph and you cannot adjust this safely without adding a huge delay in the VBA code. ...
    (microsoft.public.excel.charting)
  • RE: Saving Problem Excel 2000 with VBA code
    ... Excel whenever VBA code is attempting to save the spreadsheet and cannot do ... Is the original workbook marked as read only through windows? ... > If I double clic one of the created files, excel opens and I noticed ...
    (microsoft.public.excel.programming)

Loading