<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Answer My Searches &#187; Excel</title>
	<atom:link href="http://www.answermysearches.com/category/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.answermysearches.com</link>
	<description>Answers to everything I search for, every day</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:27:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fixing DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER When Working with Excel Files</title>
		<link>http://www.answermysearches.com/fixing-dts_e_cannotacquireconnectionfromconnectionmanager-when-working-with-excel-files/2209/</link>
		<comments>http://www.answermysearches.com/fixing-dts_e_cannotacquireconnectionfromconnectionmanager-when-working-with-excel-files/2209/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 21:49:33 +0000</pubDate>
		<dc:creator>Greg Pinero (Primary Searcher)</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.answermysearches.com/?p=2209</guid>
		<description><![CDATA[So I set up a SQL Agent Job to run my SSIS package following these steps.
Here&#8217;s the crazy thing.  The package would run perfectly when I ran it directly or via a batch file, but when I ran it through the SQL Agent Job it would die and I would see a message like [...]]]></description>
			<content:encoded><![CDATA[<p>So I set up a SQL Agent Job to run my SSIS package <a href="http://www.codeproject.com/KB/aspnet/Schedule__Run__SSIS__DTS.aspx">following these steps</a>.</p>
<p>Here&#8217;s the crazy thing.  The package would run perfectly when I ran it directly or via a batch file, but when I ran it through the SQL Agent Job it would die and I would see a message like this in the log file I set up:</p>
<p><code>DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Connection 1" failed with error code 0xC0209303.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.<br />
</code></p>
<p>I tried all of the work-arounds <a href="http://msdn.microsoft.com/en-us/library/cc627376.aspx">mentioned on this page</a>.  However none of them helped.</p>
<p>The answer it turns out is that 64 bit SQL Server Integration Services can&#8217;t handle Excel (xls) files!  The trick is to use the 32 bit runtime of dtexec.  To make the SQL Agent Job do this, go to the execution options tab of the job step and select &#8220;use 32 bit runtime&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.answermysearches.com/fixing-dts_e_cannotacquireconnectionfromconnectionmanager-when-working-with-excel-files/2209/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Find the About Menu Item in Office 2007</title>
		<link>http://www.answermysearches.com/how-to-find-the-about-menu-item-in-office-2007/1880/</link>
		<comments>http://www.answermysearches.com/how-to-find-the-about-menu-item-in-office-2007/1880/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 18:41:00 +0000</pubDate>
		<dc:creator>Greg Pinero (Primary Searcher)</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.answermysearches.com/?p=1880</guid>
		<description><![CDATA[The newer versions of Office seem to have broken from the standard help/about layout that all other programs in the universe use.  Here&#8217;s how you get to the new about menu.
For Excel 2007:
Click on the Office-logo at the top-left, then click on the &#8220;Excel options&#8221; button, then choose &#8220;Resources&#8221; in the left menu and [...]]]></description>
			<content:encoded><![CDATA[<p>The newer versions of Office seem to have broken from the standard help/about layout that all other programs in the universe use.  Here&#8217;s how you get to the new about menu.</p>
<p>For Excel 2007:</p>
<p>Click on the Office-logo at the top-left, then click on the &#8220;Excel options&#8221; button, then choose &#8220;Resources&#8221; in the left menu and then click on the &#8220;About&#8221; button.</p>
<p>I assume other Office products will work the same way.  Post a comment if you find they don&#8217;t.</p>
<p><a href="http://www.asap-utilities.com/download-help-excel-version.php">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.answermysearches.com/how-to-find-the-about-menu-item-in-office-2007/1880/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save Hours in Excel with this User Defined Function to get Cell Color</title>
		<link>http://www.answermysearches.com/save-hours-in-excel-with-this-user-defined-function-to-get-cell-color/358/</link>
		<comments>http://www.answermysearches.com/save-hours-in-excel-with-this-user-defined-function-to-get-cell-color/358/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 21:45:39 +0000</pubDate>
		<dc:creator>Greg Pinero (Primary Searcher)</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.answermysearches.com/save-hours-in-excel-with-this-user-defined-function-to-get-cell-color/358/</guid>
		<description><![CDATA[Have you ever wanted to sort or filter by the background color of cells in Excel?  There are no functions built into Excel to do such a thing, but you can still do it with this simple user defined function:

Function Color(MyRef As Range) As Long
    Color = MyRef.Interior.ColorIndex
End Function

I found installing [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to sort or filter by the background color of cells in Excel?  There are no functions built into Excel to do such a thing, but you can still do it with this simple user defined function:<br />
<code><br />
Function Color(MyRef As Range) As Long<br />
    Color = MyRef.Interior.ColorIndex<br />
End Function<br />
</code></p>
<p>I found installing it a bit convoluted (at least in Excel 2003).  First you want to make sure you get it into your personal workbook so it will always be available to you.  But when I went to the Visual Basic editor in Excel, it wouldn&#8217;t show me my personal workbook.</p>
<p>What I did was record a simple macro in Excel, being sure to select to store it in the &#8220;personal macro workbook&#8221; option.  Do something simple like type in a cell, and hit stop recording.  Then go into the Visual Basic editor again, and you can see your personal workbook (PERSONAL.XLS).  Place the function above in the same module as the macro you just recorded.  You can delete the macro you recorded now.</p>
<p>To use the function you have to call it in a funny way.  Thus to get the color of cell A3 you would type in a cell:</p>
<p><code>=PERSONAL.XLS!Color(A3)</code></p>
<p>And now you can get numeric values for the background colors in your cells!  Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.answermysearches.com/save-hours-in-excel-with-this-user-defined-function-to-get-cell-color/358/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate an Excel Formatted File Right in Python</title>
		<link>http://www.answermysearches.com/generate-an-excel-formatted-file-right-in-python/122/</link>
		<comments>http://www.answermysearches.com/generate-an-excel-formatted-file-right-in-python/122/#comments</comments>
		<pubDate>Tue, 20 Jun 2006 20:47:13 +0000</pubDate>
		<dc:creator>Greg Pinero (Primary Searcher)</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.answermysearches.com/index.php/generate-an-excel-formatted-file-right-in-python/122/</guid>
		<description><![CDATA[
It turns out that this nifty pyExcelerator program will let you write an Excel formatted document directly from Python.  
While you could always use COM automation with the Python Win32 extensions to make Excel documents, I think this library is the way to go. It lets you write an Excel file without even having [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
It turns out that this nifty <a href="http://sourceforge.net/projects/pyexcelerator/">pyExcelerator</a> program will let you write an Excel formatted document directly from Python.  </p>
<p>While you could always use COM automation with the Python Win32 extensions to make Excel documents, I think this library is the way to go. It lets you write an Excel file without even having to have Excel installed, and you don&#8217;t even need to be running on Windows.  That&#8217;s pretty neat.  It sounds like an easy way to offer an Excel output format option from your application or website, without requiring any messing with Windows or Excel.  </p>
<p>Sadly there wasn&#8217;t any friendly documentation for this project online, so here I offer my first code snippet using this package.  I mostly figured it out from the example files included with the package.  It writes a few rows of data and styles the data depending on content.<br />
<span id="more-122"></span></p>
<pre class="Python">
import pyExcelerator as xl

def save_in_excel(headers,values):
    #Open new workbook
    mydoc=xl.Workbook()
    #Add a worksheet
    mysheet=mydoc.add_sheet("test")
    #write headers
    header_font=xl.Font() #make a font object
    header_font.bold=True
    header_font.underline=True
    #font needs to be style actually
    header_style = xl.XFStyle(); header_style.font = header_font
    for col,value in enumerate(headers):
        mysheet.write(0,col,value,header_style)
    #write values and highlight those that match my criteria
    highlighted_row_font=xl.Font() #no real highlighting available?
    highlighted_row_font.bold=True
    highlighted_row_font.colour_index=2 #2 is red,
    highlighted_row_style = xl.XFStyle(); highlighted_row_style.font = highlighted_row_font
    for row_num,row_values in enumerate(values):
        row_num+=1 #start at row 1
        if row_values[1]=='Manatee':
            for col,value in enumerate(row_values):
                #make Manatee's (sp) red
                mysheet.write(row_num,col,value,highlighted_row_style)
        else:
            for col,value in enumerate(row_values):
                #normal row
                mysheet.write(row_num,col,value)
    #save file
    mydoc.save(r'C:\testpyexel.xlt')

headers=['Date','Name','Localatity']
data=[
['June 11, 2006','Greg','San Jose'],
['June 11, 2006','Greg','San Jose'],
['June 11, 2006','Greg','San Jose'],
['June 11, 2006','Greg','San Jose'],
['June 11, 2006','Manatee','San Jose'],
['June 11, 2006','Greg','San Jose'],
['June 11, 2006','Manatee','San Jose'],
]

save_in_excel(headers,data)
</pre>
<p>Here&#8217;s what my file ended up looking like:<br />
<img id="image123" src="http://www.answermysearches.com/wp-content/uploads/2006/06/Clipboard01.png" alt="Clipboard01.png" /></p>
<p>[tags]Excel, Python, Python Excel, Excel Format, pyExcelerator[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.answermysearches.com/generate-an-excel-formatted-file-right-in-python/122/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>List to CSV in 10 Seconds &#8211; Python CSV Module Quick Reference</title>
		<link>http://www.answermysearches.com/list-to-csv-in-10-seconds-python-csv-module-quick-reference/120/</link>
		<comments>http://www.answermysearches.com/list-to-csv-in-10-seconds-python-csv-module-quick-reference/120/#comments</comments>
		<pubDate>Thu, 15 Jun 2006 20:20:39 +0000</pubDate>
		<dc:creator>Greg Pinero (Primary Searcher)</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.answermysearches.com/index.php/list-to-csv-in-10-seconds-python-csv-module-quick-reference/120/</guid>
		<description><![CDATA[That's 10 seconds of developer time.  Hopefully computer time is much, much less.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the syntax to write to a CSV file:</p>
<pre class="Python">
import csv
w=csv.writer(file(r'C:\greg.csv','wb'),dialect='excel')
some_values=[[1,2,3],['A','B','C'],[4,'"5"','ab,c']]
w.writerows(some_values)
</pre>
<p>Make sure you use &#8216;wb&#8217; when you open the file.  Otherwise I&#8217;ve found that it will put a blank line between each row at least when Excel opens it.</p>
<p>Here&#8217;s the syntax for reading a csv file (from the documentation):</p>
<pre class="Python">
import csv
reader = csv.reader(open("some.csv", "rb"))
for row in reader:
    print row[0], row[-1]
</pre>
<p>And here&#8217;s the link to the full documentation:<br />
<a href="http://docs.python.org/lib/module-csv.html">http://docs.python.org/lib/module-csv.html</a><br />
And this takes you <a href="http://docs.python.org/lib/csv-examples.html">straight to the examples</a> in the documentation.</p>
<p><strong><br />
Update:</strong><br />
<a href="http://blog.doughellmann.com/2007/08/pymotw-csv.html">Another useful writeup of the CSV module.</a></p>
<p>[tags]Python, csv, csv file, comma delimited, comma seperated values, comma seperated, Python documentation[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.answermysearches.com/list-to-csv-in-10-seconds-python-csv-module-quick-reference/120/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

