Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
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 March 15th, 2006, 07:24 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using VB6 to add name to Excel Name Box

Hi,

I need advise/help for the following problem:

I have written a VB6 application to add data from a file into Excel and then select the range of data and add arange name to the Excel Name Box.

It works when I have previously assigned a name to the range in excel using the Name Box.

Is there a way to edit the Excel Name Box from a VB form?

Thanks

 
Old March 17th, 2006, 05:47 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should probably go into more detail on this problem...

On the formula bar in Excel there is the Name Box that displays the cell name you are currently in. If you have a range of data...say A1:A10 highlighted, and you click in this name box you can give the selected range a name...say "DataList01". When you hit enter that will store the name in the dropdown list in the next to the Name Box field.

If you then select another cell...say B1 and click Data on the toolbar, then click Validation, you will be given a couple of options. If you set Allow = List and the Source = "DataList01", the cell B2 will have a dropdown list with all the elements from the range A1:A10 that you called "DataList01".

As you know, you can select a range of cells in Excel from VB, but how do give the range you selected a Name using a VB program. I have the correct code to select the range, and if I name the range in Excel first then run my VB program, it works.

Any help on this would be great - thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Justification through Text Box in VB2005/VB6 saurabh_diwan Visual Studio 2005 1 April 2nd, 2007 08:36 AM
Add Push button or Check Box in outlook add-ins capdevs VS.NET 2002/2003 0 January 7th, 2006 08:51 AM
getting print dialog box in vb6 as in ms-word mohanbabu Access VBA 0 December 22nd, 2003 01:37 AM
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.