Question on VB Code in Excel

  • Thread starter Thread starter Davis
  • Start date Start date
D

Davis

On pc "A", I have 3 worksheets that are linked together
using VB buttons. The code for the buttons start with:
Application.Workbooks("workbook name").Activate
These buttons work fine - no problem.

I copied these 3 workbooks over to pc "b". When I click on
the buttons, they do not work. I have found that I have to
put the .xls extension on the "workbook name" to get the
buttons to work.

Is there an option or selection in Excel or VB that I can
change to get pc "b" to recognize the code used on pc "A"?

I would rather not have to change the code everytime I
copy the workbooks to another pc.

Thanks!
 
If you always include the .xls, you'll be better off:

application.workbooks("workbook name.xls").activate

It'll work on both pc's.

There's a setting in Windows that tells windows if it should hide or show the
extensions. If you have this set to hide, it can cause confusion with excel.

You could either make sure everyone shows the extension or just modify your code
to include the .xls.

In my Win98 system, I can toggle that setting:
Windows explorer
View|Folder Options
View Tab
Hide file extensions for known file types

(I've unchecked it on every pc I've touched, if it was checked)
 
Back
Top