Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a piece of code in Excel 2003 which at one point does this... ActiveWorkbook.SaveCopyAs FileName:=XLSsaveStr SetAttr (XLSsaveStr), vbNormal Workbooks.Open (XLSsaveStr) Workbooks(XLSsaveStrName).Activate Where XLSsaveStrName could be "data.xls" and XLSsaveStr "C:/My data/ data.xls" however the last line generates an error if I change my folder settings from view file extensions to hide extensions. That is XLSsaveStrName must become simply "data". The code worked fine until I distributed to another persons computer who has hidden file extensions. Is there a simple solution to the problem before I start attempting to change XLSsaveStrName using on error and charcter functions? The internet seemed surprisingly devoid of solutions to this problem when it could cause drastic problems for people attempting to distribute their code. Cheers Nick |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works for me in W2K + Excel XP (can't say about Excel 2003), whatever
the value of that setting: Const FILEPATHNAME As String = "C:\Test\Test.xls" ActiveWorkbook.SaveCopyAs FILEPATHNAME Workbooks.Open FILEPATHNAME You may have problems with that setting when using the Windows collection, but the Workbooks collection should not. NickHK "Nick_F" wrote in message ups.com... Hi I have a piece of code in Excel 2003 which at one point does this... ActiveWorkbook.SaveCopyAs FileName:=XLSsaveStr SetAttr (XLSsaveStr), vbNormal Workbooks.Open (XLSsaveStr) Workbooks(XLSsaveStrName).Activate Where XLSsaveStrName could be "data.xls" and XLSsaveStr "C:/My data/ data.xls" however the last line generates an error if I change my folder settings from view file extensions to hide extensions. That is XLSsaveStrName must become simply "data". The code worked fine until I distributed to another persons computer who has hidden file extensions. Is there a simple solution to the problem before I start attempting to change XLSsaveStrName using on error and charcter functions? The internet seemed surprisingly devoid of solutions to this problem when it could cause drastic problems for people attempting to distribute their code. Cheers Nick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
don't want see file name with extensions. | Excel Discussion (Misc queries) | |||
Documents move is generating link errors in Excel | Excel Discussion (Misc queries) | |||
file extensions | Excel Discussion (Misc queries) | |||
File Extensions | Excel Programming | |||
XML file extensions | Excel Discussion (Misc queries) |