|
-
Oct 1st, 2004, 09:53 PM
#1
Thread Starter
New Member
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?
Last edited by leemin; Oct 6th, 2004 at 12:25 AM.
-
Oct 1st, 2004, 10:00 PM
#2
Without seeing any code it is hard to diagnose. Although, upgrading
to Excel 2000 is probably causing the problem because the
reference in your vb exe program is no longer correct. It is
excpecting Excel 8.0 and Excel 9.0 has a different Class ID.
There may be incompatibilities running a more advanced version
as compared to an older version. If you have access to the vb
code post it so we can really help.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 3rd, 2004, 10:53 PM
#3
Thread Starter
New Member
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"
-
Oct 4th, 2004, 12:00 AM
#4
Just a guess but can you select a cell while its minimized? That
may account for it failing on the first entry. Also, a tip for dimming
your vars. just good practice to complete designate the complete
class of object you want to dimension. Keeps vb from getting
confused like when you use ADO and DAO both have Recordset
objects and if you dont differentiate the two its gets wiggy.
VB Code:
Dim appExcel As Excel.Application
Dim wSheet As Excel.Worksheet
Dim wBook As Excel.Workbook
Does your references only show one version of Excel (9.0 or 10.0)
or both? Which one shows and which should it be?
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 4th, 2004, 12:51 AM
#5
Thread Starter
New Member
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.
-
Oct 4th, 2004, 08:29 PM
#6
Ok, put this into a new vb project. Add reference to Microsoft Excel 9.0 Object Library.
VB Code:
Option Explicit
Private Sub Command1_Click()
Dim appExcel As Excel.Application
Dim wSheet As Excel.Worksheet
Dim wBook As Excel.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"
End Sub
This works for me on 2003. I just noticed that your reference is
"excel9.olb". I dont have 2000 installed anymore but isnt it
supposed to be "Microsoft Excel 9.0 Object Library" -
"C:\Program Files\Microsoft Office\Office\EXCEL.EXE". Could be
the issue. .olb = Microsoft Object Library (OLE) not the right
reference type?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 5th, 2004, 09:20 PM
#7
Thread Starter
New Member
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.
-
Oct 5th, 2004, 09:40 PM
#8
Thread Starter
New Member
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.
-
Oct 5th, 2004, 09:46 PM
#9
No prob. Glad to help.
Dont forget to edit the "Original" post's subject icon to the
resolved checkmark.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|