ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generic Window/Workbook text (https://www.excelbanter.com/excel-programming/349029-generic-window-workbook-text.html)

jase[_2_]

Generic Window/Workbook text
 
Maybe I'm missing something obvious here!
I wrote the following code as part of a routine:

Workbooks(myName).Close False
Kill "I:\" & myName & ".xls"

Problem I have encountered is that in my Window dropdown it says
"Example" whereas in the Window dropdown of other people who use the
spreadsheet it says "Example.xls" !

What would people suggest without changing the settings on either
machine?

Any help greatly appreciated.
Jason


Tom Ogilvy

Generic Window/Workbook text
 
always use the example.xls which works regardless of settings.

--
Regards,
Tom Ogilvy


"jase" wrote in message
oups.com...
Maybe I'm missing something obvious here!
I wrote the following code as part of a routine:

Workbooks(myName).Close False
Kill "I:\" & myName & ".xls"

Problem I have encountered is that in my Window dropdown it says
"Example" whereas in the Window dropdown of other people who use the
spreadsheet it says "Example.xls" !

What would people suggest without changing the settings on either
machine?

Any help greatly appreciated.
Jason




Martin Fishlock[_3_]

Generic Window/Workbook text
 
you need to check the string and I suggest this:

Workbooks(myName).Close False
Kill "I:\" & myname & IIf(LCase(Right(myname, 4)) = ".xls", "", ".xls")

There may be problems with the drive if it is not saved on I and therefore I
suggest using the following:

mynamefull = Workbooks(myName).FullName
Workbooks(myName).Close False
Kill mynamefull & IIf(LCase(Right(myname, 4)) = ".xls", "", ".xls")
' may even add the .xls on in all cases.

--
HTHs Martin


"jase" wrote:

Maybe I'm missing something obvious here!
I wrote the following code as part of a routine:

Workbooks(myName).Close False
Kill "I:\" & myName & ".xls"

Problem I have encountered is that in my Window dropdown it says
"Example" whereas in the Window dropdown of other people who use the
spreadsheet it says "Example.xls" !

What would people suggest without changing the settings on either
machine?

Any help greatly appreciated.
Jason




All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com