ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open sheet more than once? (https://www.excelbanter.com/excel-programming/447489-open-sheet-more-than-once.html)

oldyork90

open sheet more than once?
 
Do I understand this correctly?

There is one sheet A, so if function one() opens sheet A, then calls
another function two() which also opens sheet A, there shouldn't be a
problem. Right? When two()returns, one() should still have the same
"handle" to the sheet and should still be able to work with it.

But something is up. VBA is losing its brains somewhere. All of a
sudden simple range assignments fail on sheet A, but also on other
sheets. If I try and investigate and expand the sheet expression in
the Locals window, Outlook tries to install! If I just go ahead and
ignore the error (hit continue) everything seems to work just fine.

Again, about instantiating multiple "handles" on a single sheet. That
should be ok? (I'm not 100% that this is causing the problem, but
first things first.)

Thank you

Xcel 2010, xp

GS[_2_]

open sheet more than once?
 
oldyork90 has brought this to us :
Do I understand this correctly?

There is one sheet A, so if function one() opens sheet A, then calls
another function two() which also opens sheet A, there shouldn't be a
problem. Right? When two()returns, one() should still have the same
"handle" to the sheet and should still be able to work with it.

But something is up. VBA is losing its brains somewhere. All of a
sudden simple range assignments fail on sheet A, but also on other
sheets. If I try and investigate and expand the sheet expression in
the Locals window, Outlook tries to install! If I just go ahead and
ignore the error (hit continue) everything seems to work just fine.

Again, about instantiating multiple "handles" on a single sheet. That
should be ok? (I'm not 100% that this is causing the problem, but
first things first.)

Thank you

Xcel 2010, xp


Based on your explanation, *sheets* are located in *workbooks*.
Workbooks are opened, sheets are activated. What you're saying here is
that you are opening sheets when what I think you really mean is you're
opening workbook[s] and trying to reference specific sheets in the open
workbook[s].

It would be much easier to help you if you post the actual code for
both *one()* and *two()*.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



oldyork90

open sheet more than once?
 


GS wrote:
oldyork90 has brought this to us :
Do I understand this correctly?

There is one sheet A, so if function one() opens sheet A, then calls
another function two() which also opens sheet A, there shouldn't be a
problem. Right? When two()returns, one() should still have the same
"handle" to the sheet and should still be able to work with it.

But something is up. VBA is losing its brains somewhere. All of a
sudden simple range assignments fail on sheet A, but also on other
sheets. If I try and investigate and expand the sheet expression in
the Locals window, Outlook tries to install! If I just go ahead and
ignore the error (hit continue) everything seems to work just fine.

Again, about instantiating multiple "handles" on a single sheet. That
should be ok? (I'm not 100% that this is causing the problem, but
first things first.)

Thank you

Xcel 2010, xp


Based on your explanation, *sheets* are located in *workbooks*.
Workbooks are opened, sheets are activated. What you're saying here is
that you are opening sheets when what I think you really mean is you're
opening workbook[s] and trying to reference specific sheets in the open
workbook[s].

It would be much easier to help you if you post the actual code for
both *one()* and *two()*.

--
Garry


Thanks Garry. Yes I meant reference when I used handle. I've done
some experimenting and it appears you may use as many references to a
sheet as u want. Something else is going on. I'll pound my head
for awhile. The opening of outlook when trying to explode the sheet
name is really weird.
Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


GS[_2_]

open sheet more than once?
 
oldyork90 wrote :

GS wrote:
oldyork90 has brought this to us :
Do I understand this correctly?

There is one sheet A, so if function one() opens sheet A, then calls
another function two() which also opens sheet A, there shouldn't be a
problem. Right? When two()returns, one() should still have the same
"handle" to the sheet and should still be able to work with it.

But something is up. VBA is losing its brains somewhere. All of a
sudden simple range assignments fail on sheet A, but also on other
sheets. If I try and investigate and expand the sheet expression in
the Locals window, Outlook tries to install! If I just go ahead and
ignore the error (hit continue) everything seems to work just fine.

Again, about instantiating multiple "handles" on a single sheet. That
should be ok? (I'm not 100% that this is causing the problem, but
first things first.)

Thank you

Xcel 2010, xp


Based on your explanation, *sheets* are located in *workbooks*.
Workbooks are opened, sheets are activated. What you're saying here is
that you are opening sheets when what I think you really mean is you're
opening workbook[s] and trying to reference specific sheets in the open
workbook[s].

It would be much easier to help you if you post the actual code for
both *one()* and *two()*.

--
Garry


Thanks Garry. Yes I meant reference when I used handle. I've done
some experimenting and it appears you may use as many references to a
sheet as u want. Something else is going on. I'll pound my head
for awhile. The opening of outlook when trying to explode the sheet
name is really weird.
Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Like I said.., show us your code!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



isabelle

open sheet more than once?
 
hi,

do you save your files in the format xlXMLSpreadsheet?

http://msdn.microsoft.com/en-us/libr...lfileformat#Y0


isabelle




Le 2012-10-25 17:59, oldyork90 a écrit :

GS wrote:
oldyork90 has brought this to us :
Do I understand this correctly?

There is one sheet A, so if function one() opens sheet A, then calls
another function two() which also opens sheet A, there shouldn't be a
problem. Right? When two()returns, one() should still have the same
"handle" to the sheet and should still be able to work with it.

But something is up. VBA is losing its brains somewhere. All of a
sudden simple range assignments fail on sheet A, but also on other
sheets. If I try and investigate and expand the sheet expression in
the Locals window, Outlook tries to install! If I just go ahead and
ignore the error (hit continue) everything seems to work just fine.

Again, about instantiating multiple "handles" on a single sheet. That
should be ok? (I'm not 100% that this is causing the problem, but
first things first.)

Thank you

Xcel 2010, xp

Based on your explanation, *sheets* are located in *workbooks*.
Workbooks are opened, sheets are activated. What you're saying here is
that you are opening sheets when what I think you really mean is you're
opening workbook[s] and trying to reference specific sheets in the open
workbook[s].

It would be much easier to help you if you post the actual code for
both *one()* and *two()*.

--
Garry

Thanks Garry. Yes I meant reference when I used handle. I've done
some experimenting and it appears you may use as many references to a
sheet as u want. Something else is going on. I'll pound my head
for awhile. The opening of outlook when trying to explode the sheet
name is really weird.
Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



isabelle

open sheet more than once?
 
ps/ it is true that with all these formats, it is easy to get lost !



oldyork90

open sheet more than once?
 


isabelle wrote:
ps/ it is true that with all these formats, it is easy to get lost !


Went back and removed all selects (mostly from lazy macro pasting) and
problem is solved. Damn. New rule for me - no select. The pasted
macro were so busy that I suspect something there. Anyway, this
seemed the best way to fix this.

The book was saved xlsm.


All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com