open sheet more than once?

  • Thread starter Thread starter oldyork90
  • Start date Start date
O

oldyork90

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
 
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 and trying to reference specific sheets in the open
workbook.

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
 
GS said:
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 and trying to reference specific sheets in the open
workbook.

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


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.
 
oldyork90 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 and trying to reference specific sheets in the open
workbook.

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


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
 
hi,

do you save your files in the format xlXMLSpreadsheet?

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.xlfileformat#Y0


isabelle




Le 2012-10-25 17:59, oldyork90 a écrit :
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 and trying to reference specific sheets in the open
workbook.

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

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 said:
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.
 
Back
Top