PC Review


Reply
Thread Tools Rate Thread

Controlling Excel From Access

 
 
Keith Wilby
Guest
Posts: n/a
 
      12th Jun 2008
I have an Access app that creates a new worksheet in the workbook chosen by
the user via a dialog box. I would like the new worksheet to appear at the
end of the existing collection of worksheets. Would anyone happen to know
the syntax for getting a count of sheets in the current workbook and using
that count to place the new sheet at the end?

Many thanks.

Keith.

 
Reply With Quote
 
 
 
 
Dennis
Guest
Posts: n/a
 
      12th Jun 2008
xlApp is a reference to the currently opened Excel workbook and xlWS is the
reference to the new sheet you have added

xlWS.Move After:=xlApp.Worksheets(xlApp.Worksheets.Count)

"Keith Wilby" wrote:

> I have an Access app that creates a new worksheet in the workbook chosen by
> the user via a dialog box. I would like the new worksheet to appear at the
> end of the existing collection of worksheets. Would anyone happen to know
> the syntax for getting a count of sheets in the current workbook and using
> that count to place the new sheet at the end?
>
> Many thanks.
>
> Keith.
>
>

 
Reply With Quote
 
Keith Wilby
Guest
Posts: n/a
 
      12th Jun 2008
"Dennis" <(E-Mail Removed)> wrote in message
news:73A3B08C-E028-46F3-A018-(E-Mail Removed)...
> xlApp is a reference to the currently opened Excel workbook and xlWS is
> the
> reference to the new sheet you have added
>
> xlWS.Move After:=xlApp.Worksheets(xlApp.Worksheets.Count)
>


Dennis, thank you, just the job.

Regards,
Keith.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling Excel from Access VB CDM Microsoft Access VBA Modules 1 28th Jan 2010 02:26 AM
Controlling Access from Excel =?Utf-8?B?TmVpbHk=?= Microsoft Excel Programming 6 12th Nov 2005 08:20 PM
Controlling Excel from Access Andy Microsoft Access VBA Modules 1 25th Nov 2004 11:03 AM
Controlling MS Excel 97 from Access 97 (Using VBA) =?Utf-8?B?c3F1aXJlbGxl?= Microsoft Access External Data 1 28th Oct 2004 01:39 PM
Controlling MS Excel 97 from Access 97 (Using VBA) =?Utf-8?B?c3F1aXJlbGxl?= Microsoft Access External Data 0 28th Oct 2004 04:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 AM.