Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have been upgraded at work from Office and Windows 2000 to XP. I'm
having difficulty getting my macros to function. One errors on LEFT in wb1.SaveAs Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls", _ xlWorkbookNormal I referenced the Excel 10 library, as well as Word 10 and VBA and others, but I can't get it to work! Can someone please tell me what new references I need to set to make things work again? Ed |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure it will help any, but shouldn't you be using
the Excel 11 Library?? -----Original Message----- I have been upgraded at work from Office and Windows 2000 to XP. I'm having difficulty getting my macros to function. One errors on LEFT in wb1.SaveAs Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls", _ xlWorkbookNormal I referenced the Excel 10 library, as well as Word 10 and VBA and others, but I can't get it to work! Can someone please tell me what new references I need to set to make things work again? Ed . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ed,
Your code example works fine for me in ExcelXP / WinXP. Just one troubleshooting idea, use a string variable to hold the new filename. Verify that the value of the string is a valid filename (See below). Another idea is to replace "xlWorkbookNormal" with it's numeric alue: -4143 Change: wb1.SaveAs sFilename, xlWorkbookNormal To: wb1.SaveAs sFilename, -4143 Troy Sub Test1() Dim wb1 As Workbook Dim sFilename As String Set wb1 = ThisWorkbook sFilename = Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls" MsgBox "===" & sFilename & "===" & vbCr & vbCr & "Length = " & Len(sFilename) wb1.SaveAs sFilename, xlWorkbookNormal Set wb1 = Nothing End Sub "Ed" wrote in message ... I have been upgraded at work from Office and Windows 2000 to XP. I'm having difficulty getting my macros to function. One errors on LEFT in wb1.SaveAs Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls", _ xlWorkbookNormal I referenced the Excel 10 library, as well as Word 10 and VBA and others, but I can't get it to work! Can someone please tell me what new references I need to set to make things work again? Ed |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ed
If you get errors on perfectly valid syntax, check references, unselect everything marked "missing", Save and retry. Perhaps you tried that already, but worth mentioning. Your code assumes that the filename ends with ".xls". It may not if the horrid "hide file extensions for known files" is selected within Windows -and it tends to be. So first, test if the right part actually is ".xls" (test case insensitive !!!) before replacing it with "1.xls" HTH. Best wishes Harald "Ed" skrev i melding ... I have been upgraded at work from Office and Windows 2000 to XP. I'm having difficulty getting my macros to function. One errors on LEFT in wb1.SaveAs Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls", _ xlWorkbookNormal I referenced the Excel 10 library, as well as Word 10 and VBA and others, but I can't get it to work! Can someone please tell me what new references I need to set to make things work again? Ed |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Harald: Thank you! I had a MISSING reference to File Management 1.0. I
was searching for where XP stashed the new one. But when I just unchecked it, it's all fine now. I appreciate the boost. Ed "Harald Staff" wrote in message ... Hi Ed If you get errors on perfectly valid syntax, check references, unselect everything marked "missing", Save and retry. Perhaps you tried that already, but worth mentioning. Your code assumes that the filename ends with ".xls". It may not if the horrid "hide file extensions for known files" is selected within Windows -and it tends to be. So first, test if the right part actually is ".xls" (test case insensitive !!!) before replacing it with "1.xls" HTH. Best wishes Harald "Ed" skrev i melding ... I have been upgraded at work from Office and Windows 2000 to XP. I'm having difficulty getting my macros to function. One errors on LEFT in wb1.SaveAs Left(wb1.Name, Len(wb1.Name) - 4) & "1.xls", _ xlWorkbookNormal I referenced the Excel 10 library, as well as Word 10 and VBA and others, but I can't get it to work! Can someone please tell me what new references I need to set to make things work again? Ed |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Ed" skrev i melding
... Harald: Thank you! I had a MISSING reference to File Management 1.0. Glad to hear that Ed. Thanks for the feedback. Best wishes Harald |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Does XL2K have hard hyphens? | Excel Discussion (Misc queries) | |||
Copying autoshapes - XL2K | Excel Discussion (Misc queries) | |||
Need help troubleshooting an array formula XLXP on Win2K | Excel Worksheet Functions | |||
HELP! XL2K to XP -what reference am I missing? | Excel Programming | |||
Problems with xl97 & xl2K | Excel Programming |