<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Excel</title><link>http://blog.shareoffice.it/emanuele/category/23.aspx</link><description>trucchi e notizie su Excel</description><managingEditor>Emanuele Mattei</managingEditor><dc:language>it-IT</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Emanuele Mattei</dc:creator><title>VBA menu personalizzato in EXCEL</title><link>http://blog.shareoffice.it/emanuele/archive/2011/11/06/11029.aspx</link><pubDate>Sun, 06 Nov 2011 18:58:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2011/11/06/11029.aspx</guid><description>&lt;p&gt;A questo indirizzo &lt;a href="http://blog.shareoffice.it/emanuele/articles/11028.aspx"&gt;http://blog.shareoffice.it/emanuele/articles/11028.aspx&lt;/a&gt; trovate l'articolo sulla creazione di un menu di scelta rapida personalizzato, in Excel, il tutto tramite il linguaggio VBA.&lt;/p&gt;
&lt;p&gt;Che dirvi ... buona lettura :- )))&lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/11029.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>A questo indirizzo <a href="http://blog.shareoffice.it/emanuele/articles/11028.aspx">http://blog.shareoffice.it/emanuele/articles/11028.aspx</a> trovate l'articolo sulla creazione di un menu di scelta rapida personalizzato, in Excel, il tutto tramite il linguaggio VBA.</p>
<p>Che dirvi ... buona lettura :- )))</p><img src ="http://blog.shareoffice.it/emanuele/aggbug/11029.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>vba inviare email in formato html da Word e Excel </title><link>http://blog.shareoffice.it/emanuele/archive/2011/10/02/10985.aspx</link><pubDate>Sun, 02 Oct 2011 16:59:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2011/10/02/10985.aspx</guid><description>Il seguente codice di VBA, permette di inviare un email, in formato html, impostando la proprietà htmlbody.&lt;br /&gt;Ricordo di aggiungere il riferimento a Microsoft Outlook.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Private Sub CommandButton1_Click()&lt;br /&gt;On Error GoTo errore&lt;br /&gt;'creo un oggetto outlook&lt;br /&gt;Dim obj As New Outlook.Application&lt;br /&gt;'oggetto che rappresenta l'email&lt;br /&gt;Dim item As Outlook.MailItem&lt;br /&gt;'instanzio l'oggetto&lt;br /&gt;Set item = obj.CreateItem(Outlook.OlItemType.olMailItem)&lt;br /&gt;'imposto il destinatario&lt;br /&gt;item.To = "&lt;a href="mailto:Emanuelemattei@aruba.it"&gt;&lt;font color="#6699cc"&gt;Emanuelemattei@aruba.it&lt;/font&gt;&lt;/a&gt;"&lt;br /&gt;'imposto il corpo del messaggio'&lt;br /&gt;'item.Body = "Corpo del messaggio"&lt;br /&gt;'imposto l'oggetto del messaggio&lt;br /&gt;item.Subject = "Oggetto del messaggio"&lt;br /&gt;'allegato&lt;br /&gt;Set allegato = item.Attachments&lt;br /&gt;'allegato.Add "C:\mioFile.txt"&lt;br /&gt;'formato elettronico&lt;br /&gt;item.HTMLBody = "&lt;br /&gt;
&lt;p&gt;testo&lt;/p&gt;" &amp;amp; _ &lt;br /&gt;"&lt;img src="cid:Firma.jpg" width="200" height="100" /&gt;"&lt;br /&gt;'invio l'email&lt;br /&gt;item.Send&lt;br /&gt;Exit Sub&lt;br /&gt;errore:&lt;br /&gt;MsgBox (Err.Description)&lt;br /&gt;End Sub &lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10985.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml">Il seguente codice di VBA, permette di inviare un email, in formato html, impostando la proprietà htmlbody.<br />Ricordo di aggiungere il riferimento a Microsoft Outlook.<br /><br /><br /><br />Private Sub CommandButton1_Click()<br />On Error GoTo errore<br />'creo un oggetto outlook<br />Dim obj As New Outlook.Application<br />'oggetto che rappresenta l'email<br />Dim item As Outlook.MailItem<br />'instanzio l'oggetto<br />Set item = obj.CreateItem(Outlook.OlItemType.olMailItem)<br />'imposto il destinatario<br />item.To = "<a href="mailto:Emanuelemattei@aruba.it"><font color="#6699cc">Emanuelemattei@aruba.it</font></a>"<br />'imposto il corpo del messaggio'<br />'item.Body = "Corpo del messaggio"<br />'imposto l'oggetto del messaggio<br />item.Subject = "Oggetto del messaggio"<br />'allegato<br />Set allegato = item.Attachments<br />'allegato.Add "C:\mioFile.txt"<br />'formato elettronico<br />item.HTMLBody = "<br />
<p>testo</p>" &amp; _ <br />"<img src="cid:Firma.jpg" width="200" height="100" />"<br />'invio l'email<br />item.Send<br />Exit Sub<br />errore:<br />MsgBox (Err.Description)<br />End Sub <img src ="http://blog.shareoffice.it/emanuele/aggbug/10985.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>vba inviare email da excel o word con allegato </title><link>http://blog.shareoffice.it/emanuele/archive/2011/07/12/10948.aspx</link><pubDate>Tue, 12 Jul 2011 23:47:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2011/07/12/10948.aspx</guid><description>&lt;p&gt;Il seguente frammento di codice, illustra una tecnica di come inviare un email con allegato un file, dal programma Excel o Word, il tutto tramite VBA.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;Private Sub CommandButton1_Click()&lt;br /&gt;On Error GoTo errore&lt;br /&gt;'creo un oggetto outlook&lt;br /&gt;Dim obj As New Outlook.Application&lt;br /&gt;'oggetto che rappresenta l'email&lt;br /&gt;Dim item As Outlook.MailItem&lt;br /&gt;'instanzio l'oggetto&lt;br /&gt;Set item = obj.CreateItem(Outlook.OlItemType.olMailItem)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;'imposto il destinatario&lt;br /&gt;item.To = "&lt;a href="mailto:Emanuelemattei@aruba.it"&gt;&lt;font color="#6699cc"&gt;Emanuelemattei@aruba.it&lt;/font&gt;&lt;/a&gt;"&lt;br /&gt;'imposto il corpo del messaggio&lt;br /&gt;item.Body = "Corpo del messaggio"&lt;br /&gt;'imposto l'oggetto del messaggio&lt;br /&gt;item.Subject = "Oggetto del messaggio"&lt;br /&gt;'allegato&lt;br /&gt;Set allegato = item.Attachments&lt;br /&gt;allegato.Add "C:\mioFile.txt"&lt;br /&gt;'invio l'email&lt;br /&gt;item.Send&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;Exit Sub&lt;br /&gt;errore:&lt;br /&gt;MsgBox (Err.Description)&lt;/p&gt;&lt;br /&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10948.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Il seguente frammento di codice, illustra una tecnica di come inviare un email con allegato un file, dal programma Excel o Word, il tutto tramite VBA.</p><br /><br />
<p></p><br /><br />
<p>Private Sub CommandButton1_Click()<br />On Error GoTo errore<br />'creo un oggetto outlook<br />Dim obj As New Outlook.Application<br />'oggetto che rappresenta l'email<br />Dim item As Outlook.MailItem<br />'instanzio l'oggetto<br />Set item = obj.CreateItem(Outlook.OlItemType.olMailItem)</p><br /><br />
<p>'imposto il destinatario<br />item.To = "<a href="mailto:Emanuelemattei@aruba.it"><font color="#6699cc">Emanuelemattei@aruba.it</font></a>"<br />'imposto il corpo del messaggio<br />item.Body = "Corpo del messaggio"<br />'imposto l'oggetto del messaggio<br />item.Subject = "Oggetto del messaggio"<br />'allegato<br />Set allegato = item.Attachments<br />allegato.Add "C:\mioFile.txt"<br />'invio l'email<br />item.Send</p><br /><br />
<p>Exit Sub<br />errore:<br />MsgBox (Err.Description)</p><br /><img src ="http://blog.shareoffice.it/emanuele/aggbug/10948.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Rilevare i dati di Excel tramite VB.Net 2010 e C# 2010</title><link>http://blog.shareoffice.it/emanuele/archive/2010/11/02/10694.aspx</link><pubDate>Tue, 02 Nov 2010 17:33:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2010/11/02/10694.aspx</guid><description>&lt;p&gt;Qui &lt;a href="http://blog.shareoffice.it/emanuele/articles/10693.aspx"&gt;http://blog.shareoffice.it/emanuele/articles/10693.aspx&lt;/a&gt; trovate un nuovo articolo sulla programmazione Excel, in particolare come rilevare i dati di Excel, tramite la tecnologia .Net 4, con il linguaggio di programmazione VB.Net e C#.&lt;/p&gt;
&lt;p&gt;Che dirvi... buona lettura :-D&lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10694.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Qui <a href="http://blog.shareoffice.it/emanuele/articles/10693.aspx">http://blog.shareoffice.it/emanuele/articles/10693.aspx</a> trovate un nuovo articolo sulla programmazione Excel, in particolare come rilevare i dati di Excel, tramite la tecnologia .Net 4, con il linguaggio di programmazione VB.Net e C#.</p>
<p>Che dirvi... buona lettura :-D</p><img src ="http://blog.shareoffice.it/emanuele/aggbug/10694.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Esportare un file Excel 2010 in PDF tramite .Net 4 (VB.Net e C#)</title><link>http://blog.shareoffice.it/emanuele/archive/2010/09/29/10654.aspx</link><pubDate>Wed, 29 Sep 2010 22:32:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2010/09/29/10654.aspx</guid><description>&lt;p&gt;Qui &lt;a href="http://blog.shareoffice.it/emanuele/articles/10653.aspx"&gt;http://blog.shareoffice.it/emanuele/articles/10653.aspx&lt;/a&gt; trovate un nuovo articolo, riguardante la possibilità di utlizzare Excel 2010 in .Net 4 tramite VB.Net e C#.&lt;/p&gt;
&lt;p&gt;L'articolo illustra una tecnica di come esportare documenti Excel 2010 in PDF.&lt;/p&gt;
&lt;p&gt;Che dirvi... buona lettura.&lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10654.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Qui <a href="http://blog.shareoffice.it/emanuele/articles/10653.aspx">http://blog.shareoffice.it/emanuele/articles/10653.aspx</a> trovate un nuovo articolo, riguardante la possibilità di utlizzare Excel 2010 in .Net 4 tramite VB.Net e C#.</p>
<p>L'articolo illustra una tecnica di come esportare documenti Excel 2010 in PDF.</p>
<p>Che dirvi... buona lettura.</p><img src ="http://blog.shareoffice.it/emanuele/aggbug/10654.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Componente aggiuntivo per Microsoft Excel per visualizzare un calendario.</title><link>http://blog.shareoffice.it/emanuele/archive/2009/03/15/10079.aspx</link><pubDate>Sun, 15 Mar 2009 18:56:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2009/03/15/10079.aspx</guid><description>&lt;p&gt;In riferimento ad un vecchio mio articolo &lt;a href="http://blog.shareoffice.it/emanuele/articles/1500.aspx"&gt;http://blog.shareoffice.it/emanuele/articles/1500.aspx&lt;/a&gt; sulla creazione di componenti per Microsoft Excel, vi informo che ho modificato il sorgente di tale esempio, con il calendario impostato alla data odierna in cui si apre.&lt;/p&gt;
&lt;p&gt;Il componente può essere utilizzato sia per la versione Microsoft Excel 2003 e sia per la versione 2007. &lt;/p&gt;
&lt;p&gt;Per scaricare il file fate click sul collegamento qui di seguito.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="javascript:window.open('http://www.blogema.altervista.org/Calendario.zip','download');history.go(0)"&gt;Download esempio &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10079.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>In riferimento ad un vecchio mio articolo <a href="http://blog.shareoffice.it/emanuele/articles/1500.aspx">http://blog.shareoffice.it/emanuele/articles/1500.aspx</a> sulla creazione di componenti per Microsoft Excel, vi informo che ho modificato il sorgente di tale esempio, con il calendario impostato alla data odierna in cui si apre.</p>
<p>Il componente può essere utilizzato sia per la versione Microsoft Excel 2003 e sia per la versione 2007. </p>
<p>Per scaricare il file fate click sul collegamento qui di seguito.</p>
<p><br /><a href="javascript:window.open('http://www.blogema.altervista.org/Calendario.zip','download');history.go(0)">Download esempio </a><br /></p><img src ="http://blog.shareoffice.it/emanuele/aggbug/10079.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Excel convertire importi in numeri </title><link>http://blog.shareoffice.it/emanuele/archive/2009/03/01/10062.aspx</link><pubDate>Sun, 01 Mar 2009 11:52:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2009/03/01/10062.aspx</guid><description>Dal seguente sito &lt;a href="http://blogema.altervista.org/ConvertiLettere10.zip"&gt;&lt;font color="#6699cc"&gt;http://blogema.altervista.org/ConvertiLettere10.zip&lt;/font&gt;&lt;/a&gt; potete scaricare un file zippato, al cui interno, trovare due file Excel.&lt;br /&gt;Questi file excel, convertono gli importi in lettere (il tutto tramite codice VBA) .&lt;br /&gt;L'esempio di file chiamato ConvertiLettere10.xls permette di convertire gli importi in lettere compressi i centesimi.&lt;br /&gt;Mentre l'esempio ConvertiLettere10CentesimiNumerici.xls permette di convertire gli importi in lettere, escludendo i centesimi, riportandoli quest'ultimi in formato numerico.&lt;br /&gt;Potete contattarmi per qualsiasi informazione o richiesta ;-) &lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10062.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml">Dal seguente sito <a href="http://blogema.altervista.org/ConvertiLettere10.zip"><font color="#6699cc">http://blogema.altervista.org/ConvertiLettere10.zip</font></a> potete scaricare un file zippato, al cui interno, trovare due file Excel.<br />Questi file excel, convertono gli importi in lettere (il tutto tramite codice VBA) .<br />L'esempio di file chiamato ConvertiLettere10.xls permette di convertire gli importi in lettere compressi i centesimi.<br />Mentre l'esempio ConvertiLettere10CentesimiNumerici.xls permette di convertire gli importi in lettere, escludendo i centesimi, riportandoli quest'ultimi in formato numerico.<br />Potete contattarmi per qualsiasi informazione o richiesta ;-) <img src ="http://blog.shareoffice.it/emanuele/aggbug/10062.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>rilevare i dati da un foglio Excel in Asp.Net (VB.Net e C#)</title><link>http://blog.shareoffice.it/emanuele/archive/2009/02/17/10045.aspx</link><pubDate>Tue, 17 Feb 2009 21:17:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2009/02/17/10045.aspx</guid><description>&lt;p&gt;Dal seguente sito &lt;a href="http://blog.shareoffice.it/emanuele/articles/10044.aspx"&gt;http://blog.shareoffice.it/emanuele/articles/10044.aspx&lt;/a&gt; potete leggere un nuovo articolo, riguardante la tecnologia Asp.Net, in particolare la lettura dei dati in un file Microsoft Excel, tramite Visual Basic Net e C#.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/10045.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Dal seguente sito <a href="http://blog.shareoffice.it/emanuele/articles/10044.aspx">http://blog.shareoffice.it/emanuele/articles/10044.aspx</a> potete leggere un nuovo articolo, riguardante la tecnologia Asp.Net, in particolare la lettura dei dati in un file Microsoft Excel, tramite Visual Basic Net e C#.</p>
<p> </p><img src ="http://blog.shareoffice.it/emanuele/aggbug/10045.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Segnalazione articolo: Protezione di file Excel: come evitare confusioni</title><link>http://blog.shareoffice.it/emanuele/archive/2008/12/04/9842.aspx</link><pubDate>Thu, 04 Dec 2008 20:39:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2008/12/04/9842.aspx</guid><description>&lt;p&gt;Vi segnalo questo &lt;a href="http://blog.shareoffice.it/giannigiaccaglini/articles/9841.aspx"&gt;http://blog.shareoffice.it/giannigiaccaglini/articles/9841.aspx&lt;/a&gt; articolo, di Gianni Giaccaglini, esperto nazionale di Microsoft Excel 2007. L'articolo, riguarda un tema molto importante e delicato, riguardante la protezione dei dati.&lt;/p&gt;
&lt;p&gt;Excel, molte volte viene usato, per dei calcoli importanti, dati sensibili, il cui accesso dev'essere limitato. Questo articolo, illustra, come rendere il nostro foglio di calcolo (versione 2007) protetto. La sicurezza non è mai troppa.&lt;/p&gt;
&lt;p&gt;Che dirvi... buona lettura :-)))&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/9842.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Vi segnalo questo <a href="http://blog.shareoffice.it/giannigiaccaglini/articles/9841.aspx">http://blog.shareoffice.it/giannigiaccaglini/articles/9841.aspx</a> articolo, di Gianni Giaccaglini, esperto nazionale di Microsoft Excel 2007. L'articolo, riguarda un tema molto importante e delicato, riguardante la protezione dei dati.</p>
<p>Excel, molte volte viene usato, per dei calcoli importanti, dati sensibili, il cui accesso dev'essere limitato. Questo articolo, illustra, come rendere il nostro foglio di calcolo (versione 2007) protetto. La sicurezza non è mai troppa.</p>
<p>Che dirvi... buona lettura :-)))</p>
<p> </p><img src ="http://blog.shareoffice.it/emanuele/aggbug/9842.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Emanuele Mattei</dc:creator><title>Creare un documento Microsoft Word  2007 contenente una tabella con righe di colore alternato in Microsoft Exce 2007 tramite VBA</title><link>http://blog.shareoffice.it/emanuele/archive/2008/10/20/9792.aspx</link><pubDate>Mon, 20 Oct 2008 17:50:00 GMT</pubDate><guid>http://blog.shareoffice.it/emanuele/archive/2008/10/20/9792.aspx</guid><description>&lt;p&gt;Questo esempio di codice, illustra una tecnica di come creare un nuovo documento word contenente una tabella con la colorazione alternate delle righe.&lt;/p&gt;
&lt;p&gt;In Microsoft Excel, occorre aggiungere i riferimenti (strumenti-&amp;gt;riferimenti) di Microsoft Word 12.0 object library nell'editor VBA per interragire con Microsoft Word 2007.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;FAtto ciò la funzione qui di seguito, illustra questa tecnica.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="COLOR: #0000ff"&gt;Sub&lt;/span&gt; CreaTabellaWord()&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; ObjWord &lt;span style="COLOR: #0000ff"&gt;As New&lt;/span&gt; Word.Application&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; ObjDoc As Word.Document&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; ObjTable As Word.Table&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; IntRiga As Integer&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Dim&lt;/span&gt; IntColonna As Integer&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;On Error GoTo&lt;/span&gt; errore&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: #0000ff"&gt;Set&lt;/span&gt; ObjDoc = ObjWord.Documents.Add&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Set&lt;/span&gt; ObjTable = ObjDoc.Tables.Add(ObjDoc.Range, 3, 5) &lt;span style="COLOR: #00ff00"&gt;'tabella composta da 3 righe e 5 colonne&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;With&lt;/span&gt; ObjTable&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;For&lt;/span&gt; IntRiga = 1 &lt;span style="COLOR: #0000ff"&gt;To&lt;/span&gt; 3&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;For&lt;/span&gt; IntColonna = 1 &lt;span style="COLOR: #0000ff"&gt;To&lt;/span&gt; 5&lt;br /&gt;.Cell(IntRiga, IntColonna).Range.InsertAfter "Riga: " &amp;amp; IntRiga &amp;amp; ", Colonna: " &amp;amp; IntColonna&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;If&lt;/span&gt; (IntRiga Mod 2 = 0) &lt;span style="COLOR: #0000ff"&gt;Then&lt;/span&gt;&lt;br /&gt;.Cell(IntRiga, IntColonna).Range.Shading.BackgroundPatternColor = wdColorBlue&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Else&lt;/span&gt;&lt;br /&gt;.Cell(IntRiga, IntColonna).Range.Shading.BackgroundPatternColor = wdColorAqua&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Next&lt;/span&gt; IntColonna&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Next&lt;/span&gt; IntRiga&lt;br /&gt;.Columns.AutoFit&lt;br /&gt;ObjWord.Visible = &lt;span style="COLOR: #0000ff"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;End With&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;Set&lt;/span&gt; ObjTable = &lt;span style="COLOR: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Set&lt;/span&gt; ObjDoc = &lt;span style="COLOR: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Set&lt;/span&gt; ObjWord = &lt;span style="COLOR: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: #0000ff"&gt;Exit Sub&lt;/span&gt;&lt;br /&gt;errore:&lt;br /&gt;MsgBox (Err.Description)&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: #0000ff"&gt;End Sub&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tramite la parola download potete scaricare il file excel di esempio utilizzato.&lt;/p&gt;&lt;a href="http://blogema.altervista.org/EsempioCreaTabella.xlsm"&gt;&lt;font color="#6699cc"&gt;Download&lt;/font&gt;&lt;/a&gt;&lt;br /&gt;&lt;img src ="http://blog.shareoffice.it/emanuele/aggbug/9792.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Questo esempio di codice, illustra una tecnica di come creare un nuovo documento word contenente una tabella con la colorazione alternate delle righe.</p>
<p>In Microsoft Excel, occorre aggiungere i riferimenti (strumenti-&gt;riferimenti) di Microsoft Word 12.0 object library nell'editor VBA per interragire con Microsoft Word 2007.<br /></p>
<p>FAtto ciò la funzione qui di seguito, illustra questa tecnica.</p><br />
<p><span style="COLOR: #0000ff">Sub</span> CreaTabellaWord()<br /><span style="COLOR: #0000ff">Dim</span> ObjWord <span style="COLOR: #0000ff">As New</span> Word.Application<br /><span style="COLOR: #0000ff">Dim</span> ObjDoc As Word.Document<br /><span style="COLOR: #0000ff">Dim</span> ObjTable As Word.Table<br /><span style="COLOR: #0000ff">Dim</span> IntRiga As Integer<br /><span style="COLOR: #0000ff">Dim</span> IntColonna As Integer<br /><span style="COLOR: #0000ff">On Error GoTo</span> errore<br />
</p><p><span style="COLOR: #0000ff">Set</span> ObjDoc = ObjWord.Documents.Add<br /><span style="COLOR: #0000ff">Set</span> ObjTable = ObjDoc.Tables.Add(ObjDoc.Range, 3, 5) <span style="COLOR: #00ff00">'tabella composta da 3 righe e 5 colonne<br /></span><span style="COLOR: #0000ff">With</span> ObjTable<br /><span style="COLOR: #0000ff">For</span> IntRiga = 1 <span style="COLOR: #0000ff">To</span> 3<br /><span style="COLOR: #0000ff">For</span> IntColonna = 1 <span style="COLOR: #0000ff">To</span> 5<br />.Cell(IntRiga, IntColonna).Range.InsertAfter "Riga: " &amp; IntRiga &amp; ", Colonna: " &amp; IntColonna<br /><span style="COLOR: #0000ff">If</span> (IntRiga Mod 2 = 0) <span style="COLOR: #0000ff">Then</span><br />.Cell(IntRiga, IntColonna).Range.Shading.BackgroundPatternColor = wdColorBlue<br /><span style="COLOR: #0000ff">Else</span><br />.Cell(IntRiga, IntColonna).Range.Shading.BackgroundPatternColor = wdColorAqua<br /><span style="COLOR: #0000ff">End If</span><br /><span style="COLOR: #0000ff">Next</span> IntColonna<br /><span style="COLOR: #0000ff">Next</span> IntRiga<br />.Columns.AutoFit<br />ObjWord.Visible = <span style="COLOR: #0000ff">True</span><br /><span style="COLOR: #0000ff">End With<br /></span><span style="COLOR: #0000ff">Set</span> ObjTable = <span style="COLOR: #0000ff">Nothing</span><br /><span style="COLOR: #0000ff">Set</span> ObjDoc = <span style="COLOR: #0000ff">Nothing</span><br /><span style="COLOR: #0000ff">Set</span> ObjWord = <span style="COLOR: #0000ff">Nothing</span><br /><span style="COLOR: #0000ff">Exit Sub</span><br />errore:<br />MsgBox (Err.Description)<br />
</p><p><span style="COLOR: #0000ff">End Sub</span><br />
</p><p></p>
<p>Tramite la parola download potete scaricare il file excel di esempio utilizzato.</p><a href="http://blogema.altervista.org/EsempioCreaTabella.xlsm"><font color="#6699cc">Download</font></a><br /><img src ="http://blog.shareoffice.it/emanuele/aggbug/9792.aspx" width = "1" height = "1" /></body></item></channel></rss>
