Please recommend a method

  • Thread starter Thread starter Fredy
  • Start date Start date
F

Fredy

I have built a worksheet that contians control textboxes
and checkboxes. There is vb code that references these
objects, but when the file is renamed, it crashes because
of the name change. If I change to a template, Windows
appends a (1) when I open the file, so same problem. Can
anyone suggest how i should distibute this to minimize the
chance of a user breaking it while remaining functional?
Any help is greatly appreciated. thanks.
 
the predefined variable/reference ThisWorkbook refers to the workbook
containing the code. Instead of using the workbook name, use ThisWorkbook

workbooks("Mybook.xls").Worksheets("Sheet1").Range("A1").Value = 10

would be
ThisWorkbook.Worksheets("Sheet1").Range("A1").Value = 10
 
Thank you , thank you! Great help. Thanks for taking the
time to help the rest of us.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top