Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: George Evans   on Oct 18 In MS Office Category.

  
Question Answered By: Hugo Williams   on Oct 18

Thanks to all of you who have helped me so much!

As I thought, once the "All Queries" sheet  is hidden, no macro  can
reach it.

So at the beginning of each macro that needed a webquery, I wrote:

Application.ScreenUpdating=False (thanks for this, Pascal)
ThisWorkbook.Sheets("All Queries").Visible = True

and at the end:
ThisWorkbook.Sheets("All Queries").Visible = False
Application.ScreenUpdating=True

It works like magic!
I never have thought I could do that.
The people who will use it will wonder!


For now, since I still need to see that sheet very often, I did not
use Dave's proposal for :
ThisWorkbook.Sheets("Sheet2").Visible = xlSheetVeryHidden
I guess I'll introduce that only later.

The same with Private: Once it is private, you can't go to the sub
from the workbook, so I'll keep that for later too!

The only thing that I have tried (copied from the VB Help from Excel,
that I find so unhelpful), was to hide  the sheet when the book opens,
using:

Private Sub App_WorkbookOpen(ByVal "my bookname.xls" As
Workbook)
Worksheets("All Queries").Visible = False
End Sub

and I got the error message:
Compile Error: Expected identifier


Then I tried simply
Private Sub App_WorkbookOpen()
Worksheets("All Queries").Visible = False
End Sub

I did not get any compile error... but it did not work.

Sure I just have to hide it before I save, and it works perfect.

Still, eventually I'll come back and ask how to use the
App_WorkbookOpen.

Because the more I go the more ideas I have!

OK, but I am not so far yet.

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Is it possible to detect Excel version? Or get search suggestion and latest updates.


Tagged: