Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old May 21st, 2010, 03:52 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Quote:
Originally Posted by ackid32 View Post
I used the createobject method also but the result is same.
the error is '
"class does not support automation or does not support expected interface"
Error No-430

the same error with both type of codes
can u figure it out
Is Excel installed in the machine you run the code?
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Reply With Quote
  #12 (permalink)  
Old May 21st, 2010, 09:12 AM
Authorized User
 
Join Date: Mar 2009
Posts: 49
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Well, to figure out where the error is coming from, and what line is causing the error, you should have proper error handling for your debug/beta testing. As an example...
Code:
Private Sub Form_Load()
 
On Error GoTo Form_LoadError
 
Exit Sub
Form_LoadError:
 
MsgBox "FormName.Form_Load " & Err.Number & ":" & Err.Description
 
End Sub
You can also add line numbers and use Erl (see MZTools for a nice addin for VB6.0 dev environment) to track down exactly which line is causing the problem. Also, put Option Explicit at the top of each code window, as this will force you to declare everything. Then if you have any On Error Resume or On Error Resume Next or On Error GoTo 0, remove them for proper error handling and in the future so you do not have to add this manually, goto tools>options and put a checkmark next to Require Variable Declarations. Then any new projects will automatically have Option Explicit at the top of each code window...



Good Luck
Reply With Quote
  #13 (permalink)  
Old May 27th, 2010, 06:20 AM
Authorized User
Points: 208, Level: 4
Points: 208, Level: 4 Points: 208, Level: 4 Points: 208, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default yes

Quote:
Originally Posted by Shasur View Post
Is Excel installed in the machine you run the code?
Yes, Installed the same version and working perfectly
Reply With Quote
  #14 (permalink)  
Old May 27th, 2010, 06:21 AM
Authorized User
Points: 208, Level: 4
Points: 208, Level: 4 Points: 208, Level: 4 Points: 208, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by vb5prgrmr View Post
Well, to figure out where the error is coming from, and what line is causing the error, you should have proper error handling for your debug/beta testing. As an example...
Code:
Private Sub Form_Load()
 
On Error GoTo Form_LoadError
 
Exit Sub
Form_LoadError:
 
MsgBox "FormName.Form_Load " & Err.Number & ":" & Err.Description
 
End Sub
You can also add line numbers and use Erl (see MZTools for a nice addin for VB6.0 dev environment) to track down exactly which line is causing the problem. Also, put Option Explicit at the top of each code window, as this will force you to declare everything. Then if you have any On Error Resume or On Error Resume Next or On Error GoTo 0, remove them for proper error handling and in the future so you do not have to add this manually, goto tools>options and put a checkmark next to Require Variable Declarations. Then any new projects will automatically have Option Explicit at the top of each code window...



Good Luck
I already mentioned that the error was

"class does not support automation or does not support expected interface"
"Error No-430"
Reply With Quote
  #15 (permalink)  
Old May 27th, 2010, 08:03 AM
Authorized User
 
Join Date: Mar 2009
Posts: 49
Thanks: 0
Thanked 8 Times in 8 Posts
Default

But where? What line of code? What code executed before the error? All these things, and more, add up to why errors happen...
Reply With Quote
  #16 (permalink)  
Old July 26th, 2013, 04:31 AM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, you can also try this VB.NET Excel component which has no dependency with MS Office.

Here is a Hello World example to create excel file in VB.NET:
Code:
Dim workbook = New ExcelFile()

' Add new worksheet to Excel file.
Dim worksheet = workbook.Worksheets.Add("New worksheet")

' Set the value of the cell "A1".
worksheet.Cells("A1").Value = "Hello world!"

' Save Excel file.
workbook.Save("Workbook.xls")
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create excel file without Excel being installed NoXuS C# 4 August 29th, 2009 12:38 PM
Error when create Excel 2007 file in Visual Basic 2008 sektor Visual Basic 2008 Essentials 0 January 21st, 2009 03:58 AM
Create excel file in vb monika.vasvani VB Databases Basics 0 July 17th, 2008 10:24 PM
Problem in opening excel file in MS Excel 2000 kallol Visual C++ 0 November 16th, 2007 05:48 AM
Excel.exe error kliu9 Excel VBA 0 October 26th, 2004 05:21 PM



All times are GMT -4. The time now is 08:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.