Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1242

Re: Problem automating Excel 2007 under Win7

From GS <gs@somewhere.net>
Newsgroups comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion
Subject Re: Problem automating Excel 2007 under Win7
Date 2012-06-17 20:37 -0400
Organization A noiseless patient Spider
Message-ID <jrlt8n$dc3$1@dont-email.me> (permalink)
References <jrl9np$r39$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw


I figured it out by a process of msgbox following each line of my With 
block. Turns out that after investigating further, the COMAddins 
collection on the 2 test machines is empty. IOW, no COMAddins are 
installed. This is not the case with my 2 XP machines and so went 
undetected. Here's my revised code...

Sub StartApp()
  Dim xlWkb As Excel.Workbook, oCA As Variant

  On Error GoTo errExit
  Set xlApp = CreateObject("Excel.Application")
  With xlApp
    If .Version >= 12 Then
      Set xlWkb = .Workbooks.Open(FileName:=App.Path & gsAPP_WKB_UI12, 
Password:=gszPWRD)
    End If
    Set xlWkb = .Workbooks.Open(FileName:=App.Path & "\" & gszAPP_WKB, 
Password:=gszPWRD): xlWkb.RunAutoMacros xlAutoOpen
    .WindowState = xlMaximized: .Visible = True: .UserControl = True
  End With

  On Error Resume Next '//if none exist
  For Each oCA In xlApp.COMAddIns: oCA.Connect = False: Next 'oCA

errExit:
'  Screen.MousePointer = vbDefault
  Set xlWkb = Nothing: Set xlApp = Nothing
End Sub

-- 
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
    comp.lang.basic.visual.misc
    microsoft.public.vb.general.discussion

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Find similar


Thread

Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 15:04 -0400
  Re: Problem automating Excel 2007 under Win7 ralph <nt_consulting64@yahoo.com> - 2012-06-17 16:57 -0500
    Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 19:45 -0400
      Re: Problem automating Excel 2007 under Win7 "Henning" <computer_hero@coldmail.com> - 2012-06-18 01:56 +0200
        Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 20:07 -0400
          Re: Problem automating Excel 2007 under Win7 "Farnsworth" <nospam@nospam.com> - 2012-06-18 06:28 -0400
            Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-18 09:36 -0400
            Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-18 12:41 -0400
  Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 20:37 -0400

csiph-web