Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA 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 September 10th, 2003, 07:28 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Suspected Error in "Excel 2002 VBA" book

Hi,

Thank you for writting this book. I have been searching and searching for information on how to controls dynamically and progamatically. I haven't found this inforamtion anywhere else, certainly not on Microsoft's site. In particular, I like the info on dynamically creating event procedures.

That being said, I'm trying to use the code on page 210. I've typed the code exactly as shown in the book. But when I right click in a cell, I get "User defined type not found". The editor opens and the folowing code is highlighted:

Ctl As MSForms.ComboBox

I don't know why it's not found, but I am using Excel 2000.

Can you please look at this?

Also, the book lists author John Green at [email protected] but there's no such address. No big deal, but it is incorrect.

Thank you,

Robert Stober

 
Old September 11th, 2003, 10:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you remember to set the references, i.e. 'Microsoft Forms 2.0 Object Library' ?
 
Old September 11th, 2003, 04:26 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No I didn't set any references... How do I do that?

Thank you for your response,

Robert

 
Old September 12th, 2003, 01:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Choose
  Tools - References
and select the references needed.
 
Old September 12th, 2003, 04:26 AM
Authorized User
 
Join Date: May 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you no need to type the code. just download it from the site.


Quote:
quote:Originally posted by rstober
 Hi,

Thank you for writting this book. I have been searching and searching for information on how to controls dynamically and progamatically. I haven't found this inforamtion anywhere else, certainly not on Microsoft's site. In particular, I like the info on dynamically creating event procedures.

That being said, I'm trying to use the code on page 210. I've typed the code exactly as shown in the book. But when I right click in a cell, I get "User defined type not found". The editor opens and the folowing code is highlighted:

Ctl As MSForms.ComboBox

I don't know why it's not found, but I am using Excel 2000.

Can you please look at this?

Also, the book lists author John Green at [email protected] but there's no such address. No big deal, but it is incorrect.

Thank you,

Robert Stober

Deepesh Jain
VB,VBA & .NET Specialist
Wiley Support Team
 
Old September 1st, 2004, 06:33 PM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Does anybody know of a way to set the references (i.e. "Microsoft Forms 2.0 Object Library") using VBA? We have created a workbook for other people to use but we don't want to give them access to the VBA Editor to change the references themselves. Thus, we want the code to do it for them.

These users have complained of an error in the program even though it works on our own computers. In light of this, I suspect that the references on their computers may not have the above reference.

Regards
Michael

 
Old September 2nd, 2004, 06:00 AM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using this example from within your MS Office project:

Code:
Public Sub addFormsRef()
  addRefFromFile "C:\WINDOWS\System32\FM20.DLL"
End Sub

Private Sub addRefFromFile(ByVal fileName As String)
  Dim ref As Object

  For Each ref In Application.VBE.ActiveVBProject.References
    If StrComp(ref.FullPath, fileName, vbTextCompare) = 0 Then
      Exit For
    End If
  Next

  If (ref Is Nothing) Then
    Application.VBE.ActiveVBProject.References.AddFromFile fileName
  End If
End Sub

Guido
 
Old September 2nd, 2004, 05:48 PM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Guido,

Thank you for the reply. Will try the code and email back if there are still any issues.

Regards
Michael






Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002 VBA Programmer's Reference hawlk VB How-To 0 February 4th, 2007 04:35 PM
excel 2003 vba book xeugx Excel VBA 3 June 27th, 2005 11:35 PM
A simple question about date in VBA for Excel 2002 Trancefuzion Excel VBA 2 July 29th, 2004 04:37 AM
Access 2002 VBA book quality poor celletay Wrox Book Feedback 9 May 21st, 2004 07:35 AM
Excel 2002 VBA Programmers Guide quinoman Wrox Book Feedback 1 June 9th, 2003 09:07 AM





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