*Try* setting
xlApp.ScreenUpdating = False
before running the macro.
--
Regards,
Juan Pablo González
"tehwa " wrote in message
...
I have a cunning plan to open an Excel workbook and call a macro inside
that will open, then manipulate another .xls file on the hard drive
before saving it in a different location.
The .xls file is opened with a .exe file, which opens the workbook and
calls the macro in the background.
For clarity, the file is called 'macroOfDeathFile.xls', with the macro
being called 'macroOfDeath':
<VB CODE
Module fquicken
Sub Main()
Dim xlApp As Excel.Application
xlApp = CreateObject("Excel.Application")
xlApp.Application.DisplayAlerts = False
Dim wb As Excel.Workbook
wb = xlApp.Workbooks.Open("C:\macroOfDeathFile.xls")
xlApp.Visible = True
xlApp.Run("macroOfDeath")
xlApp.Quit()
xlApp = Nothing
wb = Nothing
End Sub
End Module
</VBCODE
This will execute, but I do not want Excel to be visible. Some would
say "change xlApp.Visible to false":
but if it is set to true, it executes the macro and saves a file in 3
seconds, while if it is set to 'xlApp.Visible = false' then it takes
about 1 minute.
I am hoping that someone amongst this community works in VB and Excel
who can tell me what Microsoft are playing at here, and perhaps suggest
a possible workaround.
Cheers,
tehwa
---
Message posted from http://www.ExcelForum.com/