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
 
Back
Top