PDA

View Full Version : Solved: Substitute Workbook Source Name?



YellowLabPro
05-23-2007, 06:21 AM
I wanted to swithc the way I capture the workbook source name from an input box entry to the active workbook. But this line returns error 438
Object doesn't support this propery of method.
Is this a valid method to capture workbook name and if so what is incorrect here?


'WbsName = Application.Inputbox("Enter PO File Name")
WbsName = Application.ActiveWorkbook


thanks,

Doug

mvidas
05-23-2007, 06:32 AM
Good morning Doug,

WbsName = Application.ActiveWorkbook.Name
Or just
WbsName = ActiveWorkbook.Name

:)
Matt

YellowLabPro
05-23-2007, 06:40 AM
Hi Matt,
Thanks.... Darn it....:rofl: thought I had that one....

mvidas
05-23-2007, 06:51 AM
Another thing you could do, depending on what you need the workbook name for, is to set a workbook variable for the activeworkbookdim WB as workbook
set wb=activeworkbookThen you'd only have to use WB to refer to the active workbook (instead of something like Workbooks(WbsName) which you could be doing)