<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Write to empty cell in excel</title><link>https://www.infopathdev.com:443/forums/thread/3446.aspx</link><pubDate>Wed, 08 Nov 2006 14:18:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3446</guid><dc:creator>mbenbow</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3446.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3446</wfw:commentRss><description>Hey,&lt;br /&gt;&lt;br /&gt;Without knowing the complete details of how your project will be deployed, you might be able to use the following.  It is written in VB Script:  (Note:  to use this code the form will need to be fully trusted - also, this code is off the top of my head and has not been tested.)&lt;br /&gt;&lt;br /&gt;Sub PopRowColValue(sFile, sToPop)&lt;br /&gt;&lt;br /&gt;'sFile - is the path to your excel file&lt;br /&gt;'sToPop - is the InfoPath field value to populate to Excel&lt;br /&gt;&lt;br /&gt;Dim objExcel&lt;br /&gt;Dim objActiveWorkbook&lt;br /&gt;Dim iAllRows&lt;br /&gt;Dim iLastRow&lt;br /&gt;Dim iRow&lt;br /&gt;Dim iCol&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set objExcel = CreateObject("Excel.Application")&lt;br /&gt;Set objActiveWorkbook = objExcel.Workbooks.Open(sFile)&lt;br /&gt;&lt;br /&gt;'grab all the rows of the appropriate sheet&lt;br /&gt;iAllRows = objActiveWorkbook.WorkSheets("Sheet1").Rows.Count&lt;br /&gt;&lt;br /&gt;'set to column A&lt;br /&gt;iCol = 1&lt;br /&gt;&lt;br /&gt;For iRow = 0 to iAllRows&lt;br /&gt;   If objActiveWorkbook.WorkSheets("Sheet1").Cells(iRow, iCol).Value = "" Then&lt;br /&gt;        'tag it because it is the last row for the column&lt;br /&gt;        iLastRow = iRow + 1&lt;br /&gt;        Exit For&lt;br /&gt;   End If&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;'write it to excel&lt;br /&gt;objActiveWorkbook.WorkSheets("Sheet1").Cells(iLastRow, iCol).Value = sToPop&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Sub</description></item><item><title>Write to empty cell in excel</title><link>https://www.infopathdev.com:443/forums/thread/1652.aspx</link><pubDate>Tue, 07 Nov 2006 16:34:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1652</guid><dc:creator>Turnipboy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1652.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1652</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I am a bit of a donkey with code, so could someone help me out. I would like to make infopath write the contents of a field into column A of an excel document when I hit a button. This excel file will grow as more infopath files write to it, so infopath would have to find an empty cell in column A to write to so as not to delete a previous entry.&lt;br /&gt;&lt;br /&gt;Thanks.</description></item></channel></rss>