J
james
yes
Bob Barnes said:Clif,
Set objXLWb = objXLApp.Workbooks.Open(M),1
gives a Complie error...
Expected: end of statement
Will proceed to read the Excel Help.
Thank you - Bob
Clif McIrvin said:Bob, my OE somehow missed your response .. I caught it today 'down the
thread'.
Did you get this working?
After looking again, I think
Set objXLWb = objXLApp.Workbooks.Open(M),1
should be
Set objXLWb = objXLApp.Workbooks.Open(M,1)
Clif McIrvin said:Clif McIrvin said:Bob, my OE somehow missed your response .. I caught it today 'down the
thread'.
Did you get this working?
After looking again, I think
Set objXLWb = objXLApp.Workbooks.Open(M),1
should be
Set objXLWb = objXLApp.Workbooks.Open(M,1)
Correction - this next form is incorrect syntax; the Set requires the
( )
Bob Barnes said:Clif - We've had an ice storm in Kentucky...I haven't been online in
almost 3
days.
The Set objXLWb = objXLApp.Workbooks.Open(M,1) DOES prevent the 2
Modal
Boxes from appearing, but NOT sure if it accepts the "Defaults" for
those
Modal Boxes.
I'm writing this for a User, and don't know all the Links..yet. NOT
sure if
this allows the "Defaults" to run for both Modal Boxes, or essentially
does
the "Don't Update" when opening the Excel file manually. Will study
more
today, and Post again here.
Thank you - Bob
Bob Barnes said:You'll note from the documentation that ,1 is one of 4 possible values
which I believe determines the behavior of the open. ...Yes, the 1st
vlue
updates Links...so I guess it works.
I'm going to meet w/ the User soon and ensure all the Links are
updated.
Weather...sometimes we get pretty nasty winter storms here.
Thanks again - Bob
Bob Barnes said:Thanks for the Excel code Clif.
Have a good weekend - Bob
Clif McIrvin said:You're welcome!
Here's a code snippet from one of my macros -- it's running inside of
Excel, but the idea is the same. In this case, I do *not* want to update
links; and this example uses the named argument syntax to call the open
method. It also includes some crude error handling:
Err.Clear
On Error Resume Next
Workbooks.Open Filename:=QCPath & subPath & BookName, _
UpdateLinks:=0 'do not update
Select Case Err.Number
Case 0 'successful open; return true
IsOpen = True
If Len(showView) > 0 Then
ActiveWorkbook.CustomViews(showView).Show
End If
ActiveWorkbook.Saved = True ' choosing a view did not modify the
workbook
Case 1004 'not found; return false
IsOpen = False
Case Else 'report fatal error
MsgBox Error
End Select
On Error GoTo 0
========= end code