Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I moved an Excel file from one computer to another and now I am getting an visual basic compile error

Tags:

excel

vba

Please forgive me as I know nothing of how Visual Basic works in Excel. I have moved an Excel file from one Windows 7 computer to another. Both have the same version of Office 2007. The Excel file is designed to assist one of our guys in our welding shop with the ability to create specific labels for the things he works on. From there, he is able to tag his work so he can ship it out.

There are several columns that allow him to enter different information that allows him to search for the specific labels he needs to print. When he is ready, the last column has him place an X into the column and press Enter to bring up the label for printing. When I copied the file over and try to print a label, it gives me the following message:

Compile error:

Method or data member not found.

When I click OK, it takes me to a screen that has Private Sub Worksheet_Change (ByVal Target As Range) highlighted in Yellow. The next line reads as follows: Me.BarCode1.Value = "82472" & Activesheet.Cells(2,2) The .BarCode is highlighted in Blue.

This was setup over 3 years ago and, of course, the person that set it up is no longer with the company. I am sure there is more information that I am not giving, but if someone is able to help point me in the right direction, it would be greatly appreciated.

like image 692
user3119948 Avatar asked Oct 20 '22 18:10

user3119948


1 Answers

The macro is probably using a reference to a COM library which is not installed on your computer. You can open the VBA Editor, click in the Tools>References Menu and see if there is any "Missing" reference

like image 62
kb_sou Avatar answered Oct 27 '22 16:10

kb_sou