[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Detecting the workbook name on startup

bigmart

12/19/2006 9:17:00 AM

Hi,

I'm not sure this can be done but I need to detect when a new workbook
of a given name (X) is created on Excel startup. If it is not that
workbook I need to continue as normal. If it is, I need to open another
named spreadsheet (Y), take sheet1 from the 1st spreadsheet (X) and
insert it after the last sheet in the other workbook (Y) and close (X).
I've been tearing my hair out trying to detect the name of the
spreadsheet (X) as Excel opens and haven't got any further than that.
Please help!!!

thanks

Mart

2 Answers

Nick Hodge

12/19/2006 10:45:00 AM

0

I suspect there's a logical reason why you can't put workbook_open()
event code in the workbook you are trying to detect to do all the other
stuff... that would be easy


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk


"bigmart" <martinhutchinson@hotmail.com> wrote in message
news:1166519802.460025.115130@a3g2000cwd.googlegroups.com...
> Hi,
>
> I'm not sure this can be done but I need to detect when a new workbook
> of a given name (X) is created on Excel startup. If it is not that
> workbook I need to continue as normal. If it is, I need to open another
> named spreadsheet (Y), take sheet1 from the 1st spreadsheet (X) and
> insert it after the last sheet in the other workbook (Y) and close (X).
> I've been tearing my hair out trying to detect the name of the
> spreadsheet (X) as Excel opens and haven't got any further than that.
> Please help!!!
>
> thanks
>
> Mart
>

NickHK

12/20/2006 4:59:00 AM

0

If Nick's workbook suggestion does/can not work, may be :
http://www.cpearson.com/excel/Ap...

NickHK

"bigmart" <martinhutchinson@hotmail.com> wrote in message
news:1166519802.460025.115130@a3g2000cwd.googlegroups.com...
> Hi,
>
> I'm not sure this can be done but I need to detect when a new workbook
> of a given name (X) is created on Excel startup. If it is not that
> workbook I need to continue as normal. If it is, I need to open another
> named spreadsheet (Y), take sheet1 from the 1st spreadsheet (X) and
> insert it after the last sheet in the other workbook (Y) and close (X).
> I've been tearing my hair out trying to detect the name of the
> spreadsheet (X) as Excel opens and haven't got any further than that.
> Please help!!!
>
> thanks
>
> Mart
>