|
-
Jan 18th, 2002, 01:01 PM
#1
Thread Starter
New Member
OLE Automating Portability problems
Hello all,
I wondwer if you can help me, I have some code that works in VBA and vb on my windows xp, office 2000 box, however on my windows 98, office 97 box, it works in VBA (Excel), but not in VB,
Can anyone solve this little one for me?
Heres the code...
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim data As Variant
'On Error GoTo errorhandler
'Set xlApp = New Excel.Application
Set xlApp = Excel.Application
Set xlBook = Excel.Workbooks.Add
Set xlSheet = Excel.Worksheets.Add
xlSheet.Name = "results"
xlApp.Visible = True
xlSheet.Activate
'If this line works i'll through a party
xlSheet.Cells(1, 1).Value = "hello"
'xlBook.Close False
'xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
Set xlSheet = Nothing
End
errorhandler:
MsgBox Err.Description
End
As i say this works great on my windows xp system, but not on my windows 98 system, neither anyof the other 98 system i have tried.
Each time i am referencing the Excel9.olb in the vb program but this does not seem to change anything.
The line it points to is the line with .cell(1,1).
Error message -2147417848 which means "The object invoked has disconnected from its clients".
Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|