Hi.
Newbie - but can't find an answer anywhere.
I have spreadsheet that saves file as 'c5016-custname-custcode.xlsm'
The 'c5016' is generated as a sequential number every time.
My aim is for warehouse staff to type '5016' into a cell and Excel will open the file.
The below code is very basic
Workbooks.Open Filename:="C:\00000\" & Range("i1") & ".xlsm", ReadOnly:=True
Cell i1 contains ="?"A1&"*"
It doesn't work. But if I find the actual file, 'F2' and add any char into the filename, then press enter. (basically just renaming the file as new name), It then works.
Thinking that it might only be machine specific - I have tried running the File Open code on another machine on the network - it works.
I've tried on Win 7 - same method works.
It doesn't make any difference if the original file ('c5016-custname-custcode.xlsm') is generated by MSO2007, 2010 or XP Win7.
However the VBA code must be run on MSO 2010 for this to happen. On 2007 it just interprets the wildcard as a character.
Any explanation would be great.
Newbie - but can't find an answer anywhere.
I have spreadsheet that saves file as 'c5016-custname-custcode.xlsm'
The 'c5016' is generated as a sequential number every time.
My aim is for warehouse staff to type '5016' into a cell and Excel will open the file.
The below code is very basic
Workbooks.Open Filename:="C:\00000\" & Range("i1") & ".xlsm", ReadOnly:=True
Cell i1 contains ="?"A1&"*"
It doesn't work. But if I find the actual file, 'F2' and add any char into the filename, then press enter. (basically just renaming the file as new name), It then works.
Thinking that it might only be machine specific - I have tried running the File Open code on another machine on the network - it works.
I've tried on Win 7 - same method works.
It doesn't make any difference if the original file ('c5016-custname-custcode.xlsm') is generated by MSO2007, 2010 or XP Win7.
However the VBA code must be run on MSO 2010 for this to happen. On 2007 it just interprets the wildcard as a character.
Any explanation would be great.