Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invisible Excel workbook becomes visible when another Excel is loaded 1

Status
Not open for further replies.

Sypher2

Programmer
Oct 3, 2001
160
US
I have several different applications which reference the Excel object library. I have report templates in Excel which the programs use to fill with data and print out for the users.

I set the Excel object's Visible property to False so the user cannot see it. However, if the user decides to load Excel (for whatever reason), the workbook the applications use shows up there.

Is there any way to block this or make it invisible again?
 
sorry, i read this wen u first posted and ive had a play around but i can find a way around it!!

i think (but dont quote me) that the problem stems from the fact that only one instance of excel(the main actual application) exists at one time!! and multiple instances of a workbook exist (hence the visibility issue) you may be able to get around the problem by declaring your objects withevents and forcing a shutdown (of your workbook or the new workbook) when the newworkbook(?!?! cant remeber exact event name) event is fired (bit more complex than that but possible)

or alternatively you may be able to lock your workbook from the user (but allow permissions to your program) so nothing can be "accidentally" changed!!!

this is an approach i am currently looking into and i will get back to u if it suceeds!!

in the meantime! good luck!

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
The Great Date Debate Thread222-368305
File Formats Galore @ or
 
This method stops users from loading their workbooks into your Excel by forcing them to use a new instance of Excel.

Dim oExcel as object
......
Set oExcel = CreateObject("Excel.Application")
oExcel.IgnoreRemoteRequests = True
....

The above is my method of opening Excel

Regards Mike
 
nice... i never knew that!

are there any downsides to this method that you know of??

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
The Great Date Debate Thread222-368305
File Formats Galore @ or
 
ok i found my own downside

see thread616-608840

make sure u set the ignoreremoterequests to false before exiting your program!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

or face a similar upset as me!!!!

good luck!

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
The Great Date Debate Thread222-368305
File Formats Galore @ or
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top