CreateObject("Excel.Application") Fails on NT 
Author Message
 CreateObject("Excel.Application") Fails on NT

Greetings,

I am trying to create an Excel document from within VB 6.0 on NT 4.0.

I have declared
    Dim objExcel As Object
in a module.  I then try to run excel but the subroutine fails when it
gets to
SET line.  I have used this statement on a Win 98 machine, but it fails
on my NT machine.  Any ideas?

David

Private Sub cmdGR4OMLLS_Click()

Dim slabels(1 To 4) As String
Dim dData(1 To 3, 1 To 4) As Double
Dim icnt1, icnt2, icount As Integer

Set objExcel = CreateObject("Excel.Application")



Sat, 04 Aug 2001 03:00:00 GMT  
 CreateObject("Excel.Application") Fails on NT
I work with NT machine at work and have written programs that control Excel
from VB. Here is the code that I use:
        Set xlApp = Excel.Application 'Opens Excel if not open already
        xlApp.Visible = True 'Makes it visible
        Set xlBook = xlApp.Workbooks.Add 'Adds a workbook
        xlApp.ActiveWindow.WindowState = xlMaximized 'Maximizes workbook
Quote:

> Greetings,

> I am trying to create an Excel document from within VB 6.0 on NT 4.0.

> I have declared
>     Dim objExcel As Object
> in a module.  I then try to run excel but the subroutine fails when it
> gets to
> SET line.  I have used this statement on a Win 98 machine, but it fails
> on my NT machine.  Any ideas?

> David

> Private Sub cmdGR4OMLLS_Click()

> Dim slabels(1 To 4) As String
> Dim dData(1 To 3, 1 To 4) As Double
> Dim icnt1, icnt2, icount As Integer

> Set objExcel = CreateObject("Excel.Application")



Sat, 04 Aug 2001 03:00:00 GMT  
 CreateObject("Excel.Application") Fails on NT
David,

I take it the NT box has Excel installed?

Matthew



Quote:
> Greetings,

> I am trying to create an Excel document from within VB 6.0 on NT 4.0.

> I have declared
>     Dim objExcel As Object
> in a module.  I then try to run excel but the subroutine fails when it
> gets to
> SET line.  I have used this statement on a Win 98 machine, but it fails
> on my NT machine.  Any ideas?

> David

> Private Sub cmdGR4OMLLS_Click()

> Dim slabels(1 To 4) As String
> Dim dData(1 To 3, 1 To 4) As Double
> Dim icnt1, icnt2, icount As Integer

> Set objExcel = CreateObject("Excel.Application")



Sat, 04 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. GetObject("","InternetExplorer.Application") fails in Excel VBA

2. GetObject("","InternetExplorer.Application") fails in Excel VBA

3. CreateObject("Excel","//server"), MsgBox output

4. CreateObject("Excel","//server"), MsgBox output

5. Set xLApp = CreateObject("Excel.Application")

6. Server.CreateObject("Excel.Application")

7. CreateObject("Excel.Application") problem

8. CreateObject("Excel.Application")

9. CreateObject("Excel.Application")

10. CreateObject("Excel.Application") Error

11. CreateObject("Excel.Application")

12. CreateObject("adodb.connection ") fails

 

 
Powered by phpBB® Forum Software