
Excel 97 on WinXP Pro, early bound problems in VB
What I didn't tell you is that the objApp is defined as Object is the late
bound example instead of Excel.Application from the early bound type lib.
Maybe "Excel.8" is compatable with the typed variable.
As for why I said I'd try it. Hey, I'll try anything once!
Enough talking, I'll try it when I get home and let you know.
Maybe tomorrow you can tell me "told you so"
Cheers,
Tim H
Quote:
> Why do you say to MO that you will try his method when you have already
> said:
> Change line 1 to be the late bound call: Set objApp =
> CreateObject("Excel.Application") and it works fine.
> His method is the same (late binding) except the syntax is incorrect and
it
> will raise an error. Also, adding the 8 to the argument, even properly,
> does nothing - if xl97 and xl2000 are both installed, it will not select
> excel 97 (or xl2000 if 9 is specified). the last version installed will
be
> started or whatever version the registry is pointing to.
> Regards,
> Tom Ogilvy
> > Hi Tmo,
> > It is to referencing Excel 97, but this is installed on both PCs.
> > I agree. Late binding sovles the problem but it is avoiding the issue.
> > There shouldn't be a problem.
> > Cheers,
> > Tim H
> > > is your reference in VB to the Excel 97 object library? Late binding
is
> > > probably better to avoid these type problems.
> > > Regards,
> > > Tom Ogilvy
> > > > Greetings,
> > > > Has anyone else experienced this problem before?...
> > > > Excel 97 on Windows XP Pro (SP1)
> > > > Calling from VB6... (SP5)
> > > > Set objApp = New Excel.Application
> > > > objApp.Workbooks.Open "c:\test.xls"
> > > > objApp.Workbooks(1).Close
> > > > objApp.Quit
> > > > Set objApp = Nothing
> > > > This produces an error on line 2: "Method Open of workbooks failed"
> (or
> > > > something like that)
> > > > Change line 1 to be the late bound call: Set objApp =
> > > > CreateObject("Excel.Application") and it works fine.
> > > > Anoyingly, the first example works fine on Win2000.
> > > > I already tried re-registering the app using Excel /RegServer it
> didn't
> > > fix
> > > > it.
> > > > Any clues anyone?
> > > > Thanks in advance.
> > > > Tim H