vbscript >> Rename Excel Worksheet

by nikunj shah » Thu, 30 Jun 2005 23:36:56 GMT

did u found the solution. if you have can u share it with me

thnakx
nikunj

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...


Similar Threads

1. Renaming Excel Worksheet Names after creation in VBA

Hello,

I created an excel spreadsheet using VBA Code.  It creates 3 sheets in one 
workbook acquiring the information from queries.  However, when the excel 
workbook is created and I open the file that VBA saved on my hard drive, it 
says that it had to "repair" the workbook, that there were invalid sheet 
names.  As a result, it named the sheets "Recovered_Sheet1", 
"Recovered_Sheet2" and so on.  I would like these individual sheets to be 
renamed to the queries that I got the data from. 

Is this possible within VBA?

Thank you!
MN

2. Renaming Excel Worksheets via ADO.NET - ADO.Net

3. Rename Excel Worksheet Causes Error

I tried to rename my sheet and it popped up a .xls in front of the name for 
the tab.  I deleted the .xls (Mind you this is just the name on the tab for 
one sheet in 
a series).  It now won't accept anyname and keeps telling me to I should use 
blanks or certain characters.  I have tried single letters, single numbers.  
Nothing works and it will not let me out of the sheet.

4. Rename Excel Worksheet - Excel

5. VBA to Rename Excel Worksheet Value of Cell.

Hi,

I need to write a VBA program to rename a worksheet.  The tricky part
is that I need it to be renamed to whatever a value is in a particular
cell.  For example, if cell C7 says "Management" I want the worksheet
to be renamed "Management".  Is this possible?  Any help would be
great!  Thanks.

-Idan

6. How to rename Excel Worksheet using DTS - SQL Server DTS

7. Rename excel worksheets from SAS

SAS-lers,

I am attempting to rename excel worksheets from SAS. when I run the code
below, I get an I/O error message as shown in the log below. According to
the macrofun.help there is no reason as to why this should work. Submitting
the workbook.insert line works ok.

Does anyone know how to resolve this??

Working on windowsNT and version8.2 SAS

TIA

****************************************************************************
****************************************************************************
*****
WORKBOOK.NAME
Macro Sheets Only
Equivalent to choosing the Rename command on the Sheet submenu from the
Format menu. Renames a sheet in a workbook.

Syntax

WORKBOOK.NAME(oldname_text, newname_text)
WORKBOOK.NAME?(oldname_text, newname_text)
Oldname_text    is the name of the sheet that you want to rename.
Newname_text    is the new name of the sheet.

Remarks

If you try to rename a sheet using a sheet name that already exists in the
workbook, Microsoft Excel displays an error message and interrupts the
macro.
        If the structure of the workbook is protected, you cannot rename any
of the sheets in the workbook.
****************************************************************************
***********************



filename cmds dde 'excel|SYSTEM';
 data _null_;
 file cmds;
 put '[workbook.name(sheet2, richard)]';
 *put '[workbook.insert(3)]';
run;



5379  filename cmds dde 'excel|SYSTEM';
5380   data _null_;
5381   file cmds;
5382   put '[workbook.name(sheet2, richard)]';
5383   *put '[workbook.insert(3)]';
5384  run;

NOTE: The file CMDS is:
      DDE Session,
      SESSION=excel|SYSTEM,RECFM=V,LRECL=256

ERROR: DDE session not ready.
FATAL: Unrecoverable I/O error detected in the execution of the data step
program.
        Aborted during the EXECUTION phase
NOTE: 0 records were written to the file CMDS.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.00 seconds



Richard Simhon
Business Analyst
Allianz Cornhill
Personal Lines
Tel:            +44 (0) 1483 552628
Fax:            +44 (0) 1483 552424
Email:           XXXX@XXXXX.COM 





************************************************************
Copyright in this message and any attachments remains
with us. It is confidential and may be legally privileged.
If this message is not intended for you it must not be read,
copied or used by you or disclosed to anyone else. Please
advise the sender immediately if you have received this
message in error.

Although this message and any attachments are believed
to be free of any virus or other defect that might affect
any computer system into which it is received and opened
it is the responsibility of the recipient to ensure that
it is virus free and no responsibility is accepted by
Allianz Cornhill Insurance plc for any loss or damage in
any way arising from its use.

Cornhill Life, Cornhill Direct and Allianz Global Risks
are trading names of Allianz Cornhill Insurance plc.

Petplan and DBI are part of the Allianz Cornhill group of
companies.

Allianz Cornhill Insurance plc, Registered in England
number 84638. Registered Office: 57 Ladymead, Guildford,
Surrey GU1 1DB.

Allianz Cornhill Insurance plc is authorised and regulated
by the Financial Services Authority.

Member of the General Insurance Standards Council for
general insurance business.
************************************************************

8. Using information from one worksheet, to rename inserted worksheet - Excel Functions&Formulas