Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default One button to open and re-select

I don't have any trouble opening or activating or
selecting...it's just getting it to happen with the same
button that's causing me grief.
Anyone else have any ideas?
Thank you,
Gee...

I have the following for some buttons.
To open I have:
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"

I then have another button to go back to that sheet if
it's already open.
Windows("PMP.xls").Activate
I need to know what the "IF" statement is so I don't
have to have 2 buttons.

How do I say:
If "\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls" is open,
activate "PMP.xls", else open "\\bo-10
\ToP\ToPBark\PI\aPM\PMP.xls"

I keep trying to do it and getting it wrong.
Help?
Thank you,
Gee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default One button to open and re-select

Hi
I already posted a solution for this :-)
Have you tried it?

Try a code like the following (assigned to ONE button)

...
dim wbk as workbook
on error resume next
set wbk = workbooks("PMP.xls")
on error goto 0
if wbk is nothing then
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"
set wbk = activeworkbook
end if
wbk.activate
....

-----Original Message-----
I don't have any trouble opening or activating or
selecting...it's just getting it to happen with the same
button that's causing me grief.
Anyone else have any ideas?
Thank you,
Gee...

I have the following for some buttons.
To open I have:
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"

I then have another button to go back to that sheet if
it's already open.
Windows("PMP.xls").Activate
I need to know what the "IF" statement is so I don't
have to have 2 buttons.

How do I say:
If "\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls" is open,
activate "PMP.xls", else open "\\bo-10
\ToP\ToPBark\PI\aPM\PMP.xls"

I keep trying to do it and getting it wrong.
Help?
Thank you,
Gee
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default One button to open and re-select

Yep, I tried it and it opens it the first time ok, but
when I go to another workbook, then back to
my "switchboard", where all the buttons are, then try to
go to PMP.xls again, it tells me it's already open
and "Reopening will cause any changes you made to be
discarded...etc."

-----Original Message-----
Hi
I already posted a solution for this :-)
Have you tried it?

Try a code like the following (assigned to ONE button)

...
dim wbk as workbook
on error resume next
set wbk = workbooks("PMP.xls")
on error goto 0
if wbk is nothing then
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"
set wbk = activeworkbook
end if
wbk.activate
....

-----Original Message-----
I don't have any trouble opening or activating or
selecting...it's just getting it to happen with the same
button that's causing me grief.
Anyone else have any ideas?
Thank you,
Gee...

I have the following for some buttons.
To open I have:
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"

I then have another button to go back to that sheet if
it's already open.
Windows("PMP.xls").Activate
I need to know what the "IF" statement is so I don't
have to have 2 buttons.

How do I say:
If "\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls" is open,
activate "PMP.xls", else open "\\bo-10
\ToP\ToPBark\PI\aPM\PMP.xls"

I keep trying to do it and getting it wrong.
Help?
Thank you,
Gee
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default One button to open and re-select

Hi
just tried the code again (and it worked in my environment). Could you
please post your complete used code which showed this behaviour

--
Regards
Frank Kabel
Frankfurt, Germany


wrote:
Yep, I tried it and it opens it the first time ok, but
when I go to another workbook, then back to
my "switchboard", where all the buttons are, then try to
go to PMP.xls again, it tells me it's already open
and "Reopening will cause any changes you made to be
discarded...etc."

-----Original Message-----
Hi
I already posted a solution for this :-)
Have you tried it?

Try a code like the following (assigned to ONE button)

...
dim wbk as workbook
on error resume next
set wbk = workbooks("PMP.xls")
on error goto 0
if wbk is nothing then
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"
set wbk = activeworkbook
end if
wbk.activate
....

-----Original Message-----
I don't have any trouble opening or activating or
selecting...it's just getting it to happen with the same
button that's causing me grief.
Anyone else have any ideas?
Thank you,
Gee...

I have the following for some buttons.
To open I have:
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"

I then have another button to go back to that sheet if
it's already open.
Windows("PMP.xls").Activate
I need to know what the "IF" statement is so I don't
have to have 2 buttons.

How do I say:
If "\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls" is open,
activate "PMP.xls", else open "\\bo-10
\ToP\ToPBark\PI\aPM\PMP.xls"

I keep trying to do it and getting it wrong.
Help?
Thank you,
Gee
.

.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default One button to open and re-select

OK...I did something wrong...it is working now. Thank you
so much for your patience!
Gee...
-----Original Message-----
Hi
just tried the code again (and it worked in my

environment). Could you
please post your complete used code which showed this

behaviour

--
Regards
Frank Kabel
Frankfurt, Germany


wrote:
Yep, I tried it and it opens it the first time ok, but
when I go to another workbook, then back to
my "switchboard", where all the buttons are, then try to
go to PMP.xls again, it tells me it's already open
and "Reopening will cause any changes you made to be
discarded...etc."

-----Original Message-----
Hi
I already posted a solution for this :-)
Have you tried it?

Try a code like the following (assigned to ONE button)

...
dim wbk as workbook
on error resume next
set wbk = workbooks("PMP.xls")
on error goto 0
if wbk is nothing then
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"
set wbk = activeworkbook
end if
wbk.activate
....

-----Original Message-----
I don't have any trouble opening or activating or
selecting...it's just getting it to happen with the

same
button that's causing me grief.
Anyone else have any ideas?
Thank you,
Gee...

I have the following for some buttons.
To open I have:
Workbooks.Open Filename:=
"\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls"

I then have another button to go back to that sheet if
it's already open.
Windows("PMP.xls").Activate
I need to know what the "IF" statement is so I don't
have to have 2 buttons.

How do I say:
If "\\bo-10\ToP\ToP Bark\PI\aPM\PMP.xls" is open,
activate "PMP.xls", else open "\\bo-10
\ToP\ToPBark\PI\aPM\PMP.xls"

I keep trying to do it and getting it wrong.
Help?
Thank you,
Gee
.

.


.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
find&select button,help please? Alex Charts and Charting in Excel 0 February 18th 10 11:43 AM
find&select button, help? Alex Excel Worksheet Functions 0 February 18th 10 11:40 AM
Select All button BZeyger Excel Discussion (Misc queries) 0 February 13th 09 07:34 PM
I wan to select a button Happy Excel Discussion (Misc queries) 3 September 24th 08 01:19 AM
Select Option button unhide row Wanna Learn Excel Discussion (Misc queries) 5 March 7th 08 06:38 PM


All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"