Dave_Holland89
New Member
- Joined
- Jan 18, 2018
- Messages
- 5
Hello All
Hopefully this will be a nice easy one for someone, but I just can't seem to work around this one, I'm sure I must be missing something obvious.
I've got a piece of script to download a file from Outlook based on the subject line which currently works fine, providing the subject line is a string as follows (this is an excerpt):
This works fine. However in a bid to future proof the application, I want the end user to be able to select from a number of email subjects (there may be up to 15) in a drop down box in Excel.
If I write "This is the Subject" in A1 of my sheet in the same workbook as the macro, and then replace the above with:
I just get an error - any ideas on how I can have the Macro run from a reference in a cell? I'm guessing it's because the subjectFilter is no longer a String?
Thanks!
Dave
Hopefully this will be a nice easy one for someone, but I just can't seem to work around this one, I'm sure I must be missing something obvious.
I've got a piece of script to download a file from Outlook based on the subject line which currently works fine, providing the subject line is a string as follows (this is an excerpt):
Code:
Dim subjectFilter As String
subjectFilter = "This is The Subject"
This works fine. However in a bid to future proof the application, I want the end user to be able to select from a number of email subjects (there may be up to 15) in a drop down box in Excel.
If I write "This is the Subject" in A1 of my sheet in the same workbook as the macro, and then replace the above with:
Code:
subjectFilter = Application.Workbook("C:\Documents\Daily Reports.xlsm").Worksheet("Master Sheet").Range("A1")
I just get an error - any ideas on how I can have the Macro run from a reference in a cell? I'm guessing it's because the subjectFilter is no longer a String?
Thanks!
Dave