Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2010, 02:30 AM
Registered User
 
Join Date: Aug 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Shasur,

the line Set oWB = oXlapp.Workbooks.add
gives the error "Runtime Error 424 " object required

any reference needed?
 
Old August 24th, 2010, 07:07 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

oXlapp is the object for Excel Application. Check if you have used oXlapp or xlApp. If this is xlApp please use

Set oWB = xlApp.Workbooks.add

instead of

Set oWB = oXlapp.Workbooks.add

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old August 30th, 2010, 08:59 PM
Registered User
 
Join Date: Aug 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi shasur,

it works.
can i ask how come after the new excel workbook is created i cannot open immediately on the spot?

i can only open it after i close and exit the entire vb application. in the vb i had closed and set all teh objects used to nothing after the workbook is created but my excel workbook can only be opened after the vb applicationo is totally closed

wad might cause this issue?

thanks
 
Old August 30th, 2010, 09:27 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Immediately after ths code

Set xlApp = New Excel.Application

insert the following:

xlApp.Visible = True

This will make the Application visible and you can check the changes

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old September 1st, 2010, 02:26 AM
Registered User
 
Join Date: Aug 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Shasur,

after inserting xlApp.Visible = True
still cannot open the file while the application is active

meaning that after i split the new workbook without closing my vb application i could open the workbook but is do not show the content of the excel workbook.

only after i close and exit my vb application and i reopen the new workbook then i can view the content in it.


wad is the setting missing here?

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Excel in VB6 Hornet28 VB How-To 6 December 9th, 2009 08:54 AM
VB6 Excel App to .NET problem zayasv VB.NET 0 October 24th, 2005 04:08 PM
VB6 Excel App to .NET problem zayasv General .NET 0 October 24th, 2005 04:05 PM
VB6/Excel/SQL tmiller1 Excel VBA 2 April 6th, 2005 02:10 PM
How can i open Excel From VB6 chiefouko Beginning VB 6 1 June 30th, 2003 08:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.