Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default A mixed bag of questions

Terry,

1. Is there some elegant way to cause no cell/range to be selected on a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?


No. You have to set the EnableSelection property to xlNoSelection and then
protect the sheet. Otherwise, some cell must be selected. Assuming you're
talking about programmatically controlling Excel, you can select some cell
off the visible range (accessible via ActiveWindow.VisibleRange), or select
a cell in a hidden row or column. Not very elegant, but it may be suitable
for your needs.

2. Is there any way at all to cause no cell/range to be selected on a

sheet?

See above.

3. Is there any way to import/export VBA code as plain text?


Yes. To export a module, use

ActiveWorkbook.VBProject.VBComponents("Module1").E xport _
filename:= "C:\filename.bas"

To import a module, use

ActiveWorkbook.VBProject.VBComponents.Import _
Filename:="C:\filename.bas"

For more info about working with the VBA Editor via VBA code, see
www.cpearson.com/excel/vbe.htm .

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary? In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?



No.

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?


That is the case. You can turn off screen updating, make the sheet visible,
print it, the hide the sheet. E.g.,

Application.ScreenUpdating = False
Worksheets(2).Visible = True
Worksheets(2).PrintOut
Worksheets(2).Visible = False
Application.ScreenUpdating = True

6. It would seem that one cannot cause to be selected a cell/range on a
sheet that is not the active sheet or hidden or something, is this

correct?

That is correct. Remember, however, it is almost never necessary to select
anything in VBA.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Terry von Gease" wrote in message
...
Apropos of nothing....

1. Is there some elegant way to cause no cell/range to be selected on a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?

2. Is there any way at all to cause no cell/range to be selected on a

sheet?

3. Is there any way to import/export VBA code as plain text?

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary? In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?

6. It would seem that one cannot cause to be selected a cell/range on a
sheet that is not the active sheet or hidden or something, is this

correct?

Experimentation into these matters tends to be somewhat less than
definitive. Hence the questions. We here at the home appreciate your
patience.

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default A mixed bag of questions

"Chip Pearson" wrote in message
...
Terry,

1. Is there some elegant way to cause no cell/range to be selected on a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?


No. You have to set the EnableSelection property to xlNoSelection and then
protect the sheet. Otherwise, some cell must be selected. Assuming you're
talking about programmatically controlling Excel, you can select some cell
off the visible range (accessible via ActiveWindow.VisibleRange), or

select
a cell in a hidden row or column. Not very elegant, but it may be suitable
for your needs.


As regards the above there doesn't seem to be any functional difference
between:

With Sheets(sht)
.Unprotect
.EnableSelection = xlNoSelection
.Protect UserInterfaceOnly:=True
End With

and

With Sheets(sht)
.Unprotect
.Protect UserInterfaceOnly:=True
.EnableSelection = xlNoSelection
End With

Assuming that the sheet is protected in the first place and it doesn't seem
to matter that the .EnableSelection = xlNoSelection take place during the
window of unprotection, why perform the uprotect/protect in the first place?

Even at that, no matter how it's done sometimes there is still left a range
or fragment of a range that visually appears to be selected but it really
isn't. Apparently there's a race condition somewhere and the repaint is
losing to the reselection or full attention is not being paid to setting the
Application.ScreenUpdating to true after all the manipulation and the
setting of xlNoSelection.

In light of this does there exist some sort of manual repaint method or do
you have to rely on a side effect, like switching sheets or something?

Thanks for your help....

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley



2. Is there any way at all to cause no cell/range to be selected on a

sheet?

See above.

3. Is there any way to import/export VBA code as plain text?


Yes. To export a module, use

ActiveWorkbook.VBProject.VBComponents("Module1").E xport _
filename:= "C:\filename.bas"

To import a module, use

ActiveWorkbook.VBProject.VBComponents.Import _
Filename:="C:\filename.bas"

For more info about working with the VBA Editor via VBA code, see
www.cpearson.com/excel/vbe.htm .

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary?

In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?



No.

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?


That is the case. You can turn off screen updating, make the sheet

visible,
print it, the hide the sheet. E.g.,

Application.ScreenUpdating = False
Worksheets(2).Visible = True
Worksheets(2).PrintOut
Worksheets(2).Visible = False
Application.ScreenUpdating = True

6. It would seem that one cannot cause to be selected a cell/range on a
sheet that is not the active sheet or hidden or something, is this

correct?

That is correct. Remember, however, it is almost never necessary to select
anything in VBA.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Terry von Gease" wrote in message
...
Apropos of nothing....

1. Is there some elegant way to cause no cell/range to be selected on a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?

2. Is there any way at all to cause no cell/range to be selected on a

sheet?

3. Is there any way to import/export VBA code as plain text?

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary?

In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?

6. It would seem that one cannot cause to be selected a cell/range on a
sheet that is not the active sheet or hidden or something, is this

correct?

Experimentation into these matters tends to be somewhat less than
definitive. Hence the questions. We here at the home appreciate your
patience.

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A mixed bag of questions

Try
Application.ScreenUpdating = False
Application.ScreenUpdating = True

of course, if you already had Application.ScreenUpdating = False, then there
is your huckleberry.



--
Regards,
Tom Ogilvy

Terry von Gease wrote in message
...
"Chip Pearson" wrote in message
...
Terry,

1. Is there some elegant way to cause no cell/range to be selected on

a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?


No. You have to set the EnableSelection property to xlNoSelection and

then
protect the sheet. Otherwise, some cell must be selected. Assuming

you're
talking about programmatically controlling Excel, you can select some

cell
off the visible range (accessible via ActiveWindow.VisibleRange), or

select
a cell in a hidden row or column. Not very elegant, but it may be

suitable
for your needs.


As regards the above there doesn't seem to be any functional difference
between:

With Sheets(sht)
.Unprotect
.EnableSelection = xlNoSelection
.Protect UserInterfaceOnly:=True
End With

and

With Sheets(sht)
.Unprotect
.Protect UserInterfaceOnly:=True
.EnableSelection = xlNoSelection
End With

Assuming that the sheet is protected in the first place and it doesn't

seem
to matter that the .EnableSelection = xlNoSelection take place during the
window of unprotection, why perform the uprotect/protect in the first

place?

Even at that, no matter how it's done sometimes there is still left a

range
or fragment of a range that visually appears to be selected but it really
isn't. Apparently there's a race condition somewhere and the repaint is
losing to the reselection or full attention is not being paid to setting

the
Application.ScreenUpdating to true after all the manipulation and the
setting of xlNoSelection.

In light of this does there exist some sort of manual repaint method or do
you have to rely on a side effect, like switching sheets or something?

Thanks for your help....

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley



2. Is there any way at all to cause no cell/range to be selected on a

sheet?

See above.

3. Is there any way to import/export VBA code as plain text?


Yes. To export a module, use

ActiveWorkbook.VBProject.VBComponents("Module1").E xport _
filename:= "C:\filename.bas"

To import a module, use

ActiveWorkbook.VBProject.VBComponents.Import _
Filename:="C:\filename.bas"

For more info about working with the VBA Editor via VBA code, see
www.cpearson.com/excel/vbe.htm .

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary?

In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?



No.

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?


That is the case. You can turn off screen updating, make the sheet

visible,
print it, the hide the sheet. E.g.,

Application.ScreenUpdating = False
Worksheets(2).Visible = True
Worksheets(2).PrintOut
Worksheets(2).Visible = False
Application.ScreenUpdating = True

6. It would seem that one cannot cause to be selected a cell/range on

a
sheet that is not the active sheet or hidden or something, is this

correct?

That is correct. Remember, however, it is almost never necessary to

select
anything in VBA.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Terry von Gease" wrote in message
...
Apropos of nothing....

1. Is there some elegant way to cause no cell/range to be selected on

a
sheet regardless of the state of the sheet and it's contents vis-a-vis
visibility, protection, etc?

2. Is there any way at all to cause no cell/range to be selected on a

sheet?

3. Is there any way to import/export VBA code as plain text?

4. Is there any way to control the visibility of application features,

like
formula bars, command bars, etc in a manner that is session temporary?

In
other words, is there a way to set them to whatever strikes your fancy

such
that they resume the way they were the next time someone runs Excel

without
having to reset them upon close?

5. It would seem that one cannot invoke Printout on a sheet that's not
visible. Is this the case?

6. It would seem that one cannot cause to be selected a cell/range on

a
sheet that is not the active sheet or hidden or something, is this

correct?

Experimentation into these matters tends to be somewhat less than
definitive. Hence the questions. We here at the home appreciate your
patience.

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley








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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
in excel: @ and " are mixed up? Gorilla_Bear Setting up and Configuration of Excel 1 May 29th 08 01:48 AM
Mixed 3D Charts Mark Ivey Charts and Charting in Excel 1 October 5th 06 08:12 PM
Mixed Cell prbucci Excel Worksheet Functions 2 January 13th 06 03:04 AM


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

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

About Us

"It's about Microsoft Excel"