Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default REPOST:Need help moving XL2K to XLXP, please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default REPOST:Need help moving XL2K to XLXP, please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default REPOST:Need help moving XL2K to XLXP, please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default REPOST:Need help moving XL2K to XLXP, please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default REPOST:Need help moving XL2K to XLXP, please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default REPOST:Need help moving XL2K to XLXP, please

"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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does XL2K have hard hyphens? StargateFan Excel Discussion (Misc queries) 5 February 19th 05 07:52 PM
Copying autoshapes - XL2K Ildhund Excel Discussion (Misc queries) 2 February 17th 05 02:44 AM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM
HELP! XL2K to XP -what reference am I missing? Ed[_18_] Excel Programming 1 April 23rd 04 07:08 PM
Problems with xl97 & xl2K Tom Excel Programming 3 December 11th 03 07:51 PM


All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"