Pass between modules
Hi Rob
FileName is used as a property in VBA.
Change the variable name to something else (ie MyFileName), and run your
macro.
Regards,
Per
"Rob" skrev i meddelelsen
...
Hi, I have tried to split a piece of code into separate modules for ease
of knowing what each element does, however, having done this, not all the
code works as expected. I'm work through the issues one by one but I'm
stuck on transferring a file's name that's been saved in module 1 to
module 2.
Module 1 creates a new file and saves it with a unique name derived from
the date and time, however, when I then run code in module 2, I'd like to
display after saving this file again its name. I have declared Public
FileName As String in module 1 but regardless what I do in module 2, I
can't capture FileName declare in module 1. I have Option Explicit set in
all modules and subs aren't set to Private.
Any pointers welcome. Thanks, Rob
|