set a break point and check the values of the strings.
tinstaafl
Nearly a Posting Virtuoso
1,336 posts since Jun 2010
Reputation Points: 360
Solved Threads: 235
Skill Endorsements: 14
Hi,
Try doing something like this:
Dim ConFunnelLocation As String
If trim(Form_Funnel_Report.Combo_Funnel_EBU.Text) <> "" then
ConFunnelLocation = "C:\Database\Funnel\" & trim(Form_Funnel_Report.Combo_Funnel_EBU.Text) & ".xls"
else
msgbox("Please select the excel sheet")
exit sub
end if
G_Waddell
Practically a Master Poster
621 posts since Nov 2009
Reputation Points: 107
Solved Threads: 93
Skill Endorsements: 5
I think your problem may be just as George and tins have stated.
I think you are simply passing in a string that may have an extra space or a character that's not expected.
Step through and look at the autos to see what is happening with your code.
Begginnerdev
Practically a Posting Shark
864 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8
Just occurred to me, if there's a space in the filename you may have to do this:
Dim ConFunnelLocation As String
If trim(Form_Funnel_Report.Combo_Funnel_EBU.Text) <> "" then
ConFunnelLocation = "C:\Database\Funnel\[" & trim(Form_Funnel_Report.Combo_Funnel_EBU.Text) & "].xls"
else
msgbox("Please select the excel sheet")
exit sub
end if
ACTUALLY FORGET that - rush of blood to the head!!
G_Waddell
Practically a Master Poster
621 posts since Nov 2009
Reputation Points: 107
Solved Threads: 93
Skill Endorsements: 5