
Suppressing EXCEL modal boxes through OLE
My vb4 app calls a
VBA macro in an excel spreadsheet to create sub-totals.
The excel function subtotal generates a modal box which I can't suppress
from vb. The Sendkeys statement and methods used either in the vb
calling app or in the EXCEL macro won't suppress it. I have to manually
switch to excel and deal with the modal box before the macro can continue.
Any ideas on how to not deal with the modal box.
my vb code looks like this:
Dim oXL As Object
Set oXL = GetObject("temp.xls", "EXCEL.SHEET")
' oXL.Application.SendKeys "{ENTER}"
' sendkeys call from here have no effect
oXL.Application.Run ("temp.xls!Macro1")
Set oXL = Nothing
my xls ss has a matrix with three row heading columns (ie. the first three
columns of the first row are blank. This is what causes excel concern
enough to give me the modal box prompting me to use the first row as
column headers.
my xls vba macro1 looks like this:
oTotalRange.Application.SendKeys "{ENTER}"
'SendKeys "{ENTER}" also tried sendkeys statement, no effect
oTotalRange.Subtotal GroupBy:=1, etc.