I'm using Access 2007.
I'd like to create a dynamic string variable to the use in the Transferspreads heet function in Access. The string will be the location/filename for the spreadsheet.
The string will look something like "\\Directory\Su b1\Sub2\Wk1\Exc el.xls"
I'd like to create the string with code. Example:
DirStr = "\\Directory\Su b1\Sub2\Wk" & WeekNumber & "\" & "Excel.xls"
(where WeekNumber is an interger that represents a week as a number)
The code works fine when I do not include the WeekNumber variable. But when I do this (whether the directory exists or not). The WeekNumber variable is ignored altogether and the path isn't created correctly.
What am I doing wrong? I have a suspicion it's something simple and easy to fix.
Thanks in advance.
CC
I'd like to create a dynamic string variable to the use in the Transferspreads heet function in Access. The string will be the location/filename for the spreadsheet.
The string will look something like "\\Directory\Su b1\Sub2\Wk1\Exc el.xls"
I'd like to create the string with code. Example:
DirStr = "\\Directory\Su b1\Sub2\Wk" & WeekNumber & "\" & "Excel.xls"
(where WeekNumber is an interger that represents a week as a number)
The code works fine when I do not include the WeekNumber variable. But when I do this (whether the directory exists or not). The WeekNumber variable is ignored altogether and the path isn't created correctly.
What am I doing wrong? I have a suspicion it's something simple and easy to fix.
Thanks in advance.
CC
Comment