+ Reply to Thread
Results 1 to 5 of 5

Hiding Application or a Worksheet takes away the ability to use Application properties

  1. #1
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Hiding Application or a Worksheet takes away the ability to use Application properties

    I can't figure out why this is 'useful'. I'm trying to get my app to run in what looks like a stand-alone manner (ie no Excel visibility at all). I'm hiding the window, and if there is only the one workbook open, then I'm hiding the application.

    However, when I do this the availability of the application to VBA disappears!

    If I want to hide the application from the user, it's probably because I want to do something with that application, right? So why would MS think it was constructive to hide all the application properties?

    Can anyone come up with a reason why this would be a good idea? (Seriously, I can't figure it out, and I'd love to be educated).

    Tony

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hiding Application or a Worksheet takes away the ability to use Application properties

    Hello tfurnivall,

    Hiding the Application, hides everything associated with it including the VBE. There is another approach though, but we would need to see your Code, or even better yet,
    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Hiding Application or a Worksheet takes away the ability to use Application properties

    Thanks, Winon,

    I understand what you're describing, what I can't get at is what sort of business sense it makes to release a product that behaves like this.
    I want to be able to manage the total environment, free of the possibility of a user making a well-intentioned if ill-advised change. The smart way to do this is to remove the UI of Excel. The VBE is not really hidden (after all, there's a form being displayed, right;-)

    I've attached the application. The procedure that does the nasty bit is AppInit, in ThisWorkbook. SecLogin is a form that provides logon security via a different app (also under re-development in parallel with this app), which uses a completely different workbook.

    The problems are manifested at a lower level of code, inside the CRAGConsultation form code, where all of the event handlers need to set and reset Application.EnableEvents. For that to work, I need the Application object to be available to me. And, of course it is available to me, because it's running my code! It just won't let me do anything to it. Like I said, I just don't see the business sense.

    I suppose - dons thinking cap - that I could abstract Application.EnableEvents and fake it with MyEvents or something like that, but that looks and feels like a kludge of the stickiest type, and at any rate it would really mess-up my Object Model.

    Here's AppInit:
    Please Login or Register  to view this content.
    And here's a typical event handler, showing how I use Application.EnableEvents:

    Please Login or Register  to view this content.
    You mentioned that there may be other ways of accomplishing what I want. One way that had occurred to me is to use my own substitute and work with that (MyEvents, or some such).
    Other than the fact that this would really screw up my existing development framework, it doesn't actually do what I want it to, so I'm still vulnerable to an event somewhere getting out of control and munging the whole environment.

    Yes - and the first time I saw that hidden Click event cropping up after I typed a character into a combo-box, I realized how unrestrained MS is with these things!

    Let me know if there's a better way of doing this - and I'd still love to hear a good business rationale for this type of behavior!

    Tony
    Attached Files Attached Files

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hiding Application or a Worksheet takes away the ability to use Application properties

    Hi tfurnivall,

    Wow, this is really fun!

    The damn Workbook you uploaded disabled everything, leaving nothing to work with.LOL

    Please could you change the code;

    Please Login or Register  to view this content.
    to;

    Please Login or Register  to view this content.
    or remove it altogether.

    Regards.

  5. #5
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Hiding Application or a Worksheet takes away the ability to use Application properties

    Removing it altogether is obviously a possibility! (Incidentally, stepping through AppInit and stopping after the first .Visible will restore things ;-)

    So, you see my problem (and no doubt, feel my, er, pain). But can you imagine any conceivable business value from this?

    I'm stumped.

    For now I'll go back to the way I was doing things, but it sure would be nice to 'get rid of' Excel and just leave my app :-(

    Tony

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA code to change the application.username and application.userinitials
    By jwlamb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2014, 11:25 PM
  2. [SOLVED] Obscure VBA error? Application.Run conflicts with Application.GetOpenFileName
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-15-2013, 08:31 PM
  3. I'm looking for information on the lifetime of Application Properties
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 06-03-2013, 01:55 AM
  4. Lose Application Properties
    By dasmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2011, 06:26 PM
  5. hiding application
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2011, 08:33 PM
  6. [SOLVED] hiding application
    By Chip Smith in forum Excel General
    Replies: 1
    Last Post: 04-01-2006, 05:00 AM
  7. [SOLVED] [SOLVED] Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-05-2005, 12:05 PM
  8. [SOLVED] Replace application.RTD property by Application.RTDServers collect
    By John.Greenan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1