cdbrown
06-29-2006, 06:31 AM
I'm trying to get my macro to put the filename of wb2 (well a specific portion of it) into Sheet(1) Cells(4,2) of wb1 but I'm not sure of how to call it
wb2.Name I know provides just the name of the workbook and not the full path because I can get the worksheet name to change using it. The wb2 filename is "Stuff - I04X-G.xls" and I just want the I04X-G
Cells(4,2).Select
ActiveCell.FormulaR1C1 = "B4-" & Right(Left$(wb2.Name, Len(wb2.Name) - 4), Len(wb2.Name) - 8)
Comes back with an automation error.
Cheers
-cdbrown
wb2.Name I know provides just the name of the workbook and not the full path because I can get the worksheet name to change using it. The wb2 filename is "Stuff - I04X-G.xls" and I just want the I04X-G
Cells(4,2).Select
ActiveCell.FormulaR1C1 = "B4-" & Right(Left$(wb2.Name, Len(wb2.Name) - 4), Len(wb2.Name) - 8)
Comes back with an automation error.
Cheers
-cdbrown