Desperate for some VBA help

Paul-Johnson

New Member
Joined
Feb 22, 2002
Messages
47
I have a pretty robust program in Excel. It has worked fine for months. I need to work on it tonight at home but I get a message that says it cannot find the reference librabry for many of the items.

A previous version works just fine. Any hints ? I need to make changes tonight. The file goes into production tomorrow.

Help Please !!!

PJ
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
On 2002-03-06 19:42, Paul-Johnson wrote:
I have a pretty robust program in Excel. It has worked fine for months. I need to work on it tonight at home but I get a message that says it cannot find the reference librabry for many of the items.

A previous version works just fine. Any hints ? I need to make changes tonight. The file goes into production tomorrow.

Help Please !!!

PJ

In the VBA Editor
Click on Tools
Select reference

In the dialog listbox look for any boxes with missing in them
These are the referneces you will need to
reference ie. find them in your system.


Ivan
 
Upvote 0
I have 50-60 that are unchecked. They were not ALL checked in the past.

Is there a particularly one that I should look for ? Or, should I just include them all ?

Thanks again
 
Upvote 0
On 2002-03-06 20:05, Paul-Johnson wrote:
I have 50-60 that are unchecked. They were not ALL checked in the past.

Is there a particularly one that I should look for ? Or, should I just include them all ?

Thanks again

Hi Paul
Are there any refrences with the word
"Missing" next to them ??
These are the ones you need to find.

Ivan
 
Upvote 0
When I look in the object browser and in the References dialogue box - I do not see anything with the word missing next to it
 
Upvote 0
On 2002-03-06 20:42, Paul-Johnson wrote:
When I look in the object browser and in the References dialogue box - I do not see anything with the word missing next to it

Hi Paul
OK ....what is ticked in the reference box
AND what does the program do...this will
give me an indication as to what libraries
you need....
Typical Library files are....

Visual Basics for applications, MS Excel object library, OLE automation, MS Office lirary...


Ivan
 
Upvote 0
Eaco of those is checked.

The vba makes menus, uses some custom forms to create list boxes & display messages, with a bulk of the code opening other files copying & filtering data.

The first piece of code it chokes on is "newmenu"
 
Upvote 0
On 2002-03-06 21:00, Paul-Johnson wrote:
Eaco of those is checked.

The vba makes menus, uses some custom forms to create list boxes & display messages, with a bulk of the code opening other files copying & filtering data.

The first piece of code it chokes on is "newmenu"

Paul
Could you post code that it stops on and the error.....

Ivan
 
Upvote 0
The error says Compile error:
Can't find project or library

Sub MakeMenuBar()
Dim NewMenuBar As CommandBar

' Delete menu bar if it exists
Call DeleteMenuBar

' Add a menu bar
'***** error here ******
Set NewMenuBar = CommandBars.Add(MenuBar:=True)
With NewMenuBar
.Name = "DBMenubar"
.Visible = True
End With

' Copy the File menu from Worksheet Menu Bar
CommandBars("Worksheet Menu Bar").Controls(1).Copy _
Bar:=CommandBars("DBMenubar")


' Add a new menu
Set NewMenu = NewMenuBar.Controls.Add _
(Type:=msoControlPopup)
NewMenu.Caption = "&Import Data"

' Add a new menu item
' This menu item imports the monthly Review _
for data cleanup
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "&Import Monthly Review"
.FaceId = 721
.OnAction = "open_monthly_review"
End With



' Add a new menu item
' This menu item imports the monthly master _
for report generation
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "I&mport Monthly Data"
.FaceId = 720
.OnAction = "open_Monthly_master"
End With


' Add a new menu
Set NewMenu = NewMenuBar.Controls.Add _
(Type:=msoControlPopup)
NewMenu.Caption = "&Monthly Review"

' Add a new menu item
' This menu item .....

Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "&Upload Reviewed Data"
.FaceId = 705
.OnAction = "Upload_Monthly_Master"
End With



' Add a new menu
Set NewMenu = NewMenuBar.Controls.Add _
(Type:=msoControlPopup)
NewMenu.Caption = "&Standard Reports"


' Add a new menu item
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "Weekly Report"
'.OnAction = "GetExportFileName"
End With

' Add a new menu item
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "Monthly Report"
.OnAction = "Create_Standard_Reports"
End With

' Add a new menu item
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "Customer Report"
.OnAction = "Create_customer_reports"
End With

' Add a new menu item
'Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
'With NewItem
'.Caption = "Exception Report"
'.OnAction = "GetExportFileName"
'End With

' Add a new menu
Set NewMenu = NewMenuBar.Controls.Add _
(Type:=msoControlPopup)
NewMenu.Caption = "&Exception Reports"

' Add a new menu item
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "TBD"
' .OnAction = "shell"
End With

' Add a new menu
' Set NewMenu = NewMenuBar.Controls.Add _
' (Type:=msoControlPopup)
' NewMenu.Caption = "Sa&ve Reports"
'
' ' Add a new menu item
' Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
' With NewItem
' .Caption = "Export Standard Report"
' .OnAction = "Export_Standard_Monthly"
' End With



' Add a new menu
Set NewMenu = NewMenuBar.Controls.Add _
(Type:=msoControlPopup)
NewMenu.Caption = "Admin"


' Add a new menu item
Set NewItem = NewMenu.Controls.Add(Type:=msoControlButton)
With NewItem
.Caption = "&Restore Normal Menu"
.OnAction = "DeleteMenuBar"
End With

' Copy the File menu from Worksheet Menu Bar
CommandBars("Worksheet Menu Bar").Controls(7).Copy _
Bar:=CommandBars("DBMenubar")
CommandBars("Worksheet Menu Bar").Controls(9).Copy _
Bar:=CommandBars("DBMenubar")

End Sub
 
Upvote 0
Have you got the;

Microsoft Office X.0 object Library

Ticked ?? where X.0 is your version number
eg Xl 2000 = 9.0

Ivan
 
Upvote 0

Forum statistics

Threads
1,223,401
Messages
6,171,896
Members
452,431
Latest member
TiffanyMcllwain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top