Consulting

Results 1 to 12 of 12

Thread: VBA to stop showing EXCEL icon on the Windows Task Bar -Access Opening/Closing Excel

  1. #1
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location

    VBA to stop showing EXCEL icon on the Windows Task Bar -Access Opening/Closing Excel

    Our Access Database (2003 format) opens and closes an Excel spreadsheet (.xlsm) up to 100 times to do inter-related calculations. Designed many years ago, Access opens the spreadsheet, the spreadsheet does the calculation, then Access closes the spreadsheet and keeps the results. It does it over and over again until the amounts come within a certain threshold. That's the nature of the inter-related calculations (over my head).

    For our users running Office 2010 it works just fine. But we recently started upgrading to Office 365 (2016) and this same process causes the screen to flash because you can actually see the spreadsheet opening and closing, as well as Windows displaying the EXCEL icon on the Windows Task Bar. The calculations all work, but with Office 365 all these behind the scene opening and closing of the spreadsheets that went unnoticed in Office 2010 make the screen "flash" because it appears that it simply doesn't run as well in Office 2016 with regards to doing all these behind the scenes opens/closes.

    Our question is whether or not there is something in Access vba that could turn off the "showing Excel icon on the task bar" and/or "the opening and closing of the spreadsheet". The only analogy is like the ECHO OFF in DOS. Commands are being executed BUT NOT DISPLAYED to the user. Is there something similar in ACCESS vba that would "not display" or "turn off" these extra steps that Access/Excel are doing assuming the spreadsheet is being open for User input instead of behind the scene calculations? Kind of like "working in invisible mode" while you're doing all those behind the scene opens/closes - we never really have to see the spreadsheet that's being opened/closed.

    Thank you.

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Can you show the code that opens the Excel sheet?
    You could try turning off System Warnings and Messages before the Excel manipulations with

    DoCmd.SetWarnings False

    and turn them back on again afterwards with

    DoCmd.SetWarnings True

    Access does have the same Echo Off as DOS which prevents the screen repainting

    Application.Echo False

    and turn it back on with

    Application.Echo True

  3. #3
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    I actually found the code and it's already set to FALSE. In Office 2010 it works, In Office 2016 (365) it shows Excel opening/closing the spreadsheet. The "flash" or "blink" is the open/close of the spreadsheet in Office 2016. It only takes a 1/2 second, but it does it in Office 2016 and NOT Office 2010.

    Do you think this is a know ISSUE with Office 2016? That's crazy! I didn't realize there was a .visible for the application you're calling FROM ACCESS with vba, but I think it's THERE, it's just NOT working.

    Looking for additional clues/hints. blnVisible = FALSE
        pobjBook.Windows(1).Visible = blnVisible
        pobjExcel.Visible = blnVisible

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Yes but the code that I provided is working on the Access Window, not the Excel one, so it should be worth a try at least.

  5. #5
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    Because the spreadsheet is mainly used "behind the scenes" the workbook_open event has a single line of code to default to the "menu" tab.
    Sheets("Menu").Select

  6. #6
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    I added the third line and now the "spreadsheet" doesn't display (THIS IS GOING IN THE RIGHT DIRECTION), but the EXCEL icon turns off/on at the bottom of the screen in the Windows Task Bar. Which .visible property would that be?


        pobjBook.Windows(1).Visible = blnVisible
        pobjExcel.Visible = blnVisible
        pobjSheet.Visible = blnVisible
    Last edited by maxis; 11-10-2017 at 01:10 PM.

  7. #7
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Did you try the Set Warnings as well?
    Is it the Windows Task Bar or the Access Bottom Bar?

  8. #8
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Have tried the more normal Visible VBA code ie
    AppExcel.Visible = True or AppExcel.Visible = False

  9. #9
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    Definitely Windows Task Bar.
    Last edited by maxis; 11-10-2017 at 01:23 PM.

  10. #10
    Banned VBAX Regular
    Joined
    Nov 2017
    Posts
    12
    Location
    By accident I commented out all three lines of code and now in Office 365 (2016) it doesn't display the spreadsheet or the Excel icon on the Windows Task Bar. It works with the 3 lines of code commented out. What the heck; now I'm just confused.

  11. #11
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Well, it looks as if those lines are actually redundant, as it works OK You could probably delete them.
    At least you have fixed it.
    VBA can be like that sometimes.

  12. #12
    Quote Originally Posted by maxis View Post
    It works with the 3 lines of code commented out. What the heck; now I'm just confused.
    What as the value of blnVisible in your code? If it was true you were explicitly displaying the Excel windows and the observed behavior was perfectly logical.
    Learn VBA from the ground up with my VBA Online Courses.

Posting Permissions

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