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.
Re: Open Excel workbooks without showing them
try:
appExcel.Workbooks.Application.Visible = True
should make the Excel application unvisible to the user!
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
Re: Open Excel workbooks without showing them
Try this before you open the workbook:
Code:
appExcel.DisplayAlerts = False
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