Results 1 to 5 of 5

Thread: Open Excel workbooks without showing them

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    19

    Open Excel workbooks without showing them

    I suppose it's a really simple task, but I tried to search and could't find in help.

    I'm in VBA PPT and I want to open a workbook to get data from it, and then close it.

    Code:
    Set wbExcel = appExcel.Workbooks.Open(path)
    Here's what I have to open the workbook, but the problem is that I don't want to see the message telling me to enable macros and the Excel workbook, I want it to run in background.

    I read somewhere about WithWindow:=msoFalse but that didn't work since it's a workbook.

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Open Excel workbooks without showing them

    try:
    appExcel.Workbooks.Application.Visible = True

    should make the Excel application unvisible to the user!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    19

    Re: Open Excel workbooks without showing them

    Quote Originally Posted by opus
    try:
    appExcel.Workbooks.Application.Visible = True

    should make the Excel application unvisible to the user!
    It nearly works perfectly, it blocks the screen but I still see the Excel window and the "Enable Macros" msgbox

  4. #4
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    617

    Re: Open Excel workbooks without showing them

    Try this before you open the workbook:

    Code:
    appExcel.DisplayAlerts = False

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Open Excel workbooks without showing them

    Using ADO in PowerPoint you can open and retrieve data from Excel without using Excel COM.

    My FAQ example of reading the sheet names with ADO:
    http://vbforums.com/showthread.php?t=442232
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width