Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It could be the file extension that is causing the problem, if the value in
d39 does not have one. Try: Set bk1 = Workbooks(sstr & ".xls") 'modify for xl2007 ActiveWorkbook.SaveCopyAs filename:=bk1 "Andyjim" wrote: I am trying to saving a file based on the text name in a designated cell in the workbook. However, with this code, I get an €śsubscript out of range€ť error. Do you know what I am doing wrong? Thanks for your help. Windows("fxRM_Update.xls").Activate Dim bk As Workbook, bk1 As Workbook Dim sstr As String Set bk = Workbooks("fxRM_update.xls") sstr = bk.Worksheets("lookup").Range("d39").Value Set bk1 = Workbooks(sstr) ActiveWorkbook.SaveCopyAs filename:=Workbooks(bk1) Andy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refresh produces #N/A error | Links and Linking in Excel | |||
Refresh produces #N?A error | Excel Discussion (Misc queries) | |||
CreateObject produces error | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming |