Disappearing Macros

Joined
Nov 14, 2006
Messages
2
Reaction score
0
I am trying to add a macro in "Book1" that takes a string parameter, a directory, that it will use later to save a copy of the spreadsheet. Problem is every time I put anything in the parameter section of the procedure, it doesn't show up on the list of macros for Book1 when you select Alt-F8.

Public Sub CopyAllSheetsToDBF(SaveDir as String)
' processing

ActiveWorkbook.SaveAs Filename:=SaveDir & FileName

End Sub

But if I take the parameter out of the definition:

Public Sub CopyAllSheetsToDBF()
' processing

ActiveWorkbook.SaveAs Filename:=SaveDir & FileName

End Sub

Then the macro does show up when I do Alt-F8

This is driving me batty!

Carole Shaw (ohvelma)
 
I think I have figured it out. The macro still exists, it just isn't visible, because since it has parameters, it isn't available for the users to select, but it can be called from another macro.


Carole
 

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