Add data to excel

  • Thread starter Thread starter Jessie
  • Start date Start date
J

Jessie

Hi.

Is there a way to add data to an existing Excel SS? I have
a table of appointments that gets updated daily. Each new
appointment needs to be added to the SS in Red text and
the old appointments should be in black. They also would
like to see the new appointments at the top of the SS
instead of the bottom. I was wondering if there is a way
to do this in code.

Thanks,
Jessie
 
Why not show whoever thinks you need the appointmwnts in Excel how easy it
is to display and colorcode the appointments in Access!!
 
Hi, I just did this! Unsolved problem - it doesn't save ok if the
spreadsheet was already open. Here's some code:

Dim xlApp as object, xlW as Object, xlS as object, xlC as object
Dim mySpreadsheet as string

mySpreadsheet = "C:\Test\test.xls"
set xlApp = CreateObject("Excel.Application") ' open Excel
xlApp.Visible=True
set xlW = xlApp.Workbooks.Open(mySpreadsheet)
set xlS = xlW.Worksheets("My Page") ' use actual page name
set xlC = xlS.Range("A1") ' xlC is cell A1
xlC.Value = DLookup("[last_name]", "Employees")

set xlC=nothing
set xlS = nothing
xlW.close
set xlW = Nothing
xlApp.Quit
set xlApp = Nothing
 
Our Client requires us to email the SS to them daily. It's
not my place to dictate to the client how they receive
their data.
 
Thank you thank you : )
-----Original Message-----
Hi, I just did this! Unsolved problem - it doesn't save ok if the
spreadsheet was already open. Here's some code:

Dim xlApp as object, xlW as Object, xlS as object, xlC as object
Dim mySpreadsheet as string

mySpreadsheet = "C:\Test\test.xls"
set xlApp = CreateObject("Excel.Application") ' open Excel
xlApp.Visible=True
set xlW = xlApp.Workbooks.Open(mySpreadsheet)
set xlS = xlW.Worksheets("My Page") ' use actual page name
set xlC = xlS.Range
("A1") ' xlC is cell A1
xlC.Value = DLookup("[last_name]", "Employees")

set xlC=nothing
set xlS = nothing
xlW.close
set xlW = Nothing
xlApp.Quit
set xlApp = Nothing

Jessie said:
Hi.

Is there a way to add data to an existing Excel SS? I have
a table of appointments that gets updated daily. Each new
appointment needs to be added to the SS in Red text and
the old appointments should be in black. They also would
like to see the new appointments at the top of the SS
instead of the bottom. I was wondering if there is a way
to do this in code.

Thanks,
Jessie
.
 
Back
Top