Disable Peek and Show the Peek

I want to stop the user of a Excel macro workbook from seeing the preview peek of eth Queries. I have gone into the Options|Global and unticked the Show Query peek when hovering. But of course you can still right click on the query and see the peek.

I have also found out that the Global setting above is not saved with the workbook.

How can I prevent the user of the workbook seeing a peek of the data from a Query either by hovering or right-clicking on teh query?

I am happy to use vba code if necessary.

Allister

Hi @AllisterB,

Didn’t find anything promissing on how to disable “Show the peek”

But I did find this and that might be of intrest…

1 Like

Hi @AllisterB, did the response provided by @Melissa help in solving your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.

I did not find a solution to this - I was aware of that use of Protect E Workbook prevents editing of eth Query. I did discover on the net that the ability to disable Show the Peek is still a request with Microsoft.

Thank You Melissa for the time you put into the reply

Allister

Thanks for sharing that with the community @AllisterB.

Hi @AllisterB,
That sounds interesting: What is the issue with the peek view? I understand that someone wants to hide or protect the code, but what reason is there to hide the peek?

Protecting the wb greys out a lot, so do that to make the access to the code more difficult.
Disable the cmdbar with CommandBars(“Queries and Connections”).Enabled = False
No cmdbar => no peek view.

You can disable when opening the file. And better enable back when closing the file! :blush:

Regards,
Matthias

1 Like

Hi Matthias

I have attached a couple of Files. the word doc is a screen shot from the Excel File. With the workbook protected (no p/w) I then right-click on the Query and choose Show Peek - and I get teh screen in the Word Document. this shows the user the data itself - this is not what I want. I want to be able to disable the Show Peek that shows when you go right-click

Peek.xlsx (17.2 KB)
Peek Doc.docx (64.7 KB)

Thanks

Allister

@Allister, if the wb is protected and the cmdbar disabled users will not see any query pane nor have access to the code.

Disable within wb_Open and enable in wb_Close:
Private Sub Workbook_Open()

End Sub

Hi @AllisterB, just wanted to check if you still need help here. Please don’t forget to mark this post as solved if issue has been solved. Thanks