Finding Workbook name - HELP

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I need to show an inputform only when a certain workbook is open. the problem
i am having is that when i open the file, i input info into the inputform and
when i hit enter, it saves a copy of the file as another name but with the
same code, hense "inputform.show" stuff. I dont want the new file name to
show the inputform when it is open, only show when origional is opened.
something like this maybe? thx

If WorkbookName = "Filename.xls" Then
InputForm.Show
Else
Do nothing
End If
 
Hi Jim, A built in quirk in Excel is that if you save the file that is
running the code module under a different name, it takes the code right along
with it. One way around it is to just copy the sheets from one workbook to
another, or another way is to put your code in a separate workbook than the
one you are saving.
 
If lcase(Application.Thisworkbook.Name) = lcase("Filename.xls") Then
InputForm.Show
Else
Do nothing
End If
 

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