automation error 2147417848
I has this program written in vb6, with excel object. It works fine previously. Now it has this error when it start to put in values to the excel sheet. I use excel 9.0 object lib as reference. It work when it is office97, but now I upgrade office2000 then this error.
Any one has the same experience?
automation error 2147417848
I don't think its got anything to do with O97 or O2K. I tried uninstall O2K, delete all office keys from registry, re-install O97, it doesn't work. Next I do the same but re-install O2K, with SP3, still it doesn't work. My code is very simple, basically create an excel object, book object and sheet object. Then I begin to put in values in the cells of the worksheet. It is fine when creating these object, but its fails when it begin to put in the very first value. Here are my codes:
Dim appexcel As Excel.Application
Dim wSheet As Worksheet
Dim wBook As Workbook
Set appexcel = CreateObject("excel.application")
appexcel.Visible = True
appexcel.WindowState = xlMinimized
appexcel.Workbooks.Add
Set wSheet = appexcel.Sheets(1)
wSheet.Select
wSheet.Cells(1, 1).Value = "S/No"
automation error 2147417848
1) yes, with minimized it used to work previously. ok I tried omit that and test, still it won't work.
2) I also tried your method ie fully qualified method (dim wsheet as excel.worksheet). It doesn't work.
3) there is only 1 excel reference, which is excel9.olb
This is driving me crazy. THere are quite a bit of info on this error code at msdn, but none are related to mine.
automation error 2147417848
excel9.olb is the correct file for ms excel 9.0 object library. actually I had tried your code earlier, but nevertheless, I uninstall vb6 & reinstall vb6 with sp5 and try your code.. yet it still won't work. Next I tried a new project, but this time instead of excel I create word object and write a line of text and it works!! So the fact that I have fresh install of office2K and vb6, yet it still has this error for excel, could it be some other files or registry is corrupted? Maybe I will try with another PC or totally forget about excel automation but to use other report means probably crystal report.
But it really sucks.. microsoft is so unstable, I mean it used to work but now it just don't work no matter what I tried.
automation error 2147417848 (RESOLVED)
ok it's confirmed!! I tried running the appl from a client PC, and the excel automation works!! Though I still don't know what's the files in my development PC that are corrupted, but at least I know the cause. The option left now for me is to re-install my OS which is win98 but I don't think I will do that - too much work.
A very big THANK YOU to Robdog888, for all your assistant and tips along the way.