473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: Renaming Excel Spreadsheets

Greg Lindstrom wrote:
Hello,

I am working with Python to create Excel spreadsheets and have run into
a couple of problems I hope you can help me with.

First...are there any bindings/libraries into Open Office?

Now, back to Excel.

--Does anyone know a way to create N worksheets? By default, 3 are
created, but I would like more.

--Is it possible to rename a worksheet inside of the workbook (change
"Sheet1" to "July 08", for example).
Here's some code from years back that adds sheets to a workbook and then
renames them.

Sheets = [["SlsSrce",None,1],
["SalesReps",None,1],
["Control",None,1]]

replist = []
for k in repkeys:
if k in currentReps:
replist.append([k, reps[k]])
Sheets.append(['Rep-%s' % k, None, 1])

def WorkBookSetup(Sheets):
# xl.Visible = 1
wbi = xl.Workbooks.Add()
wbi.Activate()
sheetcount = xl.Sheets.Count
index = 0
for name, ref, nextline in Sheets:
if index >= sheetcount:
wbi.Sheets.Add()
index = index + 1
index = 0
for name, ref, nextline in Sheets:
wbi.Sheets[index].Name = name
Sheets[index][1] = wbi.Sheets[index]
index = index + 1
return wbi

HTH,

Emile

Aug 26 '08 #1
0 856

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: smonczka | last post by:
I have a DTS package that needs to refresh data in 3 separate Excel spreadsheets on a daily basis. The problem is that unless I manually delete the previous day's data, it appends rather than...
3
by: Elliot | last post by:
The program loops through a dataset and creates several spreadsheets based on a change in a particular column. With each new spreadsheet I launch a new instance of excel. After about 100...
0
by: Rich Wallace | last post by:
Hello all, Looking for suggestions and tips if possible. I have an application running on a file server that utilizes the FileSystemWatcher to trap when any Excel files are saved by a user. I...
2
by: Jim S | last post by:
To my surprise and chagrin, newer versions of Access have disabled the functionality that lets users change the data in linked tables that point to a range in an Excel workbook. This is "because of...
19
by: wreckingcru | last post by:
I'm trying to output a SQL query that is constructed thru my VB.net GUI into an excel file. Here is the code I'm using: 'Sqlstmt is the SQL query statement 'Conn is the SQL Connection object...
1
by: Mitch | last post by:
I am using Access to create an Excel spreadsheets with graphs related to rows on the sheet1 to the graph on sheet2. I am using the same data but different subsets of the data to make different...
3
by: TC | last post by:
My project has a reference to the Excel 9.0 Object Library. My understanding is that, by using a reference to 9.0, I make my application compatible with Excel 2000, 2002, and 2003. If I use a...
0
by: DrewYK | last post by:
I have the project that may never end in front of me. I am creating a routine that will take SpreadSheets from Excel and bring them into Access. I am not using any "DoCmd"s because the goal...
1
by: thadson | last post by:
Hi, I'm trying to import specific cells from MS Excel 2000 spreadsheets to MS Access 2000 tables then move the spreadsheets to a different directory. I'm very new to this and I'm having trouble...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.