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 > Beginning VB 6
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Thread Tools Display Modes
  #1 (permalink)  
Old March 15th, 2006, 07:24 PM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using VB6 to add name to Excel Name Box


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?


Reply With Quote
  #2 (permalink)  
Old March 17th, 2006, 05:47 AM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

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

Reply With Quote

Thread Tools
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
Full Justification through Text Box in VB2005/VB6 saurabh_diwan Visual Studio 2005 1 April 2nd, 2007 09: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 09:28 AM

All times are GMT -4. The time now is 09:33 PM.

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