Refer to workbook by beginning of filename (as end changes)

  • Every day I run a macro.


    Every day the macro leaves open a source file (it copies info into a new workbook).


    I can't reliably close the source file within the Macro because the source file has a naming format like


    VendorBacklog4343242343 (the numbers aren't a date or anything I can predict). Today's was 82435386 - which I hoped might be Unix time, but this is 1972 in Unix time.


    Anyway I can refer to the file as "filebeginning(VendorBacklog).close" or some such?


    THANKS

  • Re: Refer to workbook by beginning of filename (as end changes)


    Assuming you mean an Excel workbook is left open...


    You can iterate all the open workbooks looking for a partial title. If you find it, you can set a workbook type variable to point at the workbook and then do what you want...



    (Typed freehand - untested)


    If you meant another type of window, then please elaborate...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!