Connecting Tech Pros Worldwide Forums | Help | Site Map

Access Excel Automation Question

Keith Wilby
Guest
 
Posts: n/a
#1: Mar 28 '07
How controllable from Access VBA is Excel? I'm currently using automation
to dump 2 columns of data into an Excel spreadsheet so that the end user can
create a line graph based on it. Could the line graph be created from
Access as part of the automation process? Is it also possible to rename the
Excel worksheets from Access?

Thanks.

Keith.



Tom van Stiphout
Guest
 
Posts: n/a
#2: Mar 28 '07

re: Access Excel Automation Question


On Wed, 28 Mar 2007 10:21:26 +0100, "Keith Wilby" <here@there.com>
wrote:

Yes, thanks to the power of Automation.
Once you have a reference to Excel.Application, you can use its entire
object model to do anything you want.
Tip: install Excel in its entirety, including the VBA help file.
Tip: use the Macro recorder in Excel to see what it would use to
create a line graph or rename a doc.

-Tom.

Quote:
>How controllable from Access VBA is Excel? I'm currently using automation
>to dump 2 columns of data into an Excel spreadsheet so that the end user can
>create a line graph based on it. Could the line graph be created from
>Access as part of the automation process? Is it also possible to rename the
>Excel worksheets from Access?
>
>Thanks.
>
>Keith.
>
Keith Wilby
Guest
 
Posts: n/a
#3: Mar 28 '07

re: Access Excel Automation Question


"Tom van Stiphout" <no.spam.tom7744@cox.netwrote in message
news:oask039dh3j8ojvau0vuqjs6qe7h4l3f0n@4ax.com...
Quote:
On Wed, 28 Mar 2007 10:21:26 +0100, "Keith Wilby" <here@there.com>
wrote:
>
Yes, thanks to the power of Automation.
Once you have a reference to Excel.Application, you can use its entire
object model to do anything you want.
Tip: install Excel in its entirety, including the VBA help file.
Tip: use the Macro recorder in Excel to see what it would use to
create a line graph or rename a doc.
>
Thanks Tom, I'll give it a go.

Keith.


Keith Wilby
Guest
 
Posts: n/a
#4: Mar 29 '07

re: Access Excel Automation Question


"Tom van Stiphout" <no.spam.tom7744@cox.netwrote in message
news:oask039dh3j8ojvau0vuqjs6qe7h4l3f0n@4ax.com...
Quote:
On Wed, 28 Mar 2007 10:21:26 +0100, "Keith Wilby" <here@there.com>
wrote:
>
Yes, thanks to the power of Automation.
Once you have a reference to Excel.Application, you can use its entire
object model to do anything you want.
Tip: install Excel in its entirety, including the VBA help file.
Tip: use the Macro recorder in Excel to see what it would use to
create a line graph or rename a doc.
>
OK I'm stuck on something that should be really simple - I want to create a
new worksheet and give it a specific name. The best I can come up with is

With objXL.Sheets.Add
.Name = "Boat " & Me.cboBoat
End With

but this adds TWO sheets, one with the name I want and one name "Sheet n" -
any ideas?

Many thanks,
Keith.


Keith Wilby
Guest
 
Posts: n/a
#5: Mar 29 '07

re: Access Excel Automation Question


"Keith Wilby" <here@there.comwrote in message
news:460b7919$1_1@glkas0286.greenlnk.net...

Never mind, penny has dropped :-)

objXL.Sheets.Add
objXL.ActiveSheet.Name = "Boat " & Me.cboBoat.Value

Keith.


Closed Thread


Similar Microsoft Access / VBA bytes