<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>VBA Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'VBA' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Fri, 03 Jul 2009 20:20:14 -0700</pubDate>
    <lastBuildDate>Fri, 03 Jul 2009 20:20:14 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>VBA Outlook app - keeping a sql connection open indefinetely</title>
      <link>http://www.programmersheaven.com/mb/vba/393233/393233/vba-outlook-app---keeping-a-sql-connection-open-indefinetely/</link>
      <description>I'm doing a bit of work with an Outlook VBA application that a colleauge created. It's fairly basic, just connects to a sql server and runs some commands, depending on what the user is changing etc. The problem we're having is in trying to speed it up. It's not slow, but at the moment every time the user clicks to add some time (it's mostly a time-keeping thing), it opens a connection to the server, processes the stuff the user sends, and then closes the connection when it's done. When the user is simply updating a tiny bit of data, say a single field update in the database, it seems (to my boss) to be terribly wasteful to open a new connection, do some stuff, and then just close it. Therefore, I - with my very little experience of programming - have been tasked with trying to answer the question; would it be possible/quicker/safe to simply have the form open a connection when it's first opened for the day, and then keep it open until outlook is closed at the end of the day? &lt;br /&gt;
&lt;br /&gt;
So, can you do this? There's only a handful of staff in the office, 50 at most, so the server won't fall over trying to keep 50 connections open (I assume!). Will it be alot quicker than opening a connection and closing it again? Is it secure to keep a connection open for such a long time? Am I asking too many questions?&lt;br /&gt;
&lt;br /&gt;
Thanks for any replies,&lt;br /&gt;
Barns&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/393233/393233/vba-outlook-app---keeping-a-sql-connection-open-indefinetely/</guid>
      <pubDate>Fri, 03 Jul 2009 03:59:53 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>attached</title>
      <link>http://www.programmersheaven.com/mb/vba/393107/393107/attached/</link>
      <description>sorry it seems that my file has not been attached to my post. &lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=721"&gt;Book1.zip&lt;/a&gt; (27207 bytes | downloaded 3 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/393107/393107/attached/</guid>
      <pubDate>Wed, 01 Jul 2009 03:52:47 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>tagging or labeling variables</title>
      <link>http://www.programmersheaven.com/mb/vba/393103/393103/tagging-or-labeling-variables/</link>
      <description>Hi.&lt;br /&gt;
&lt;br /&gt;
I am writing a VBA (VBA in Excel) code for testing different combination of 24 variables and recording a result which corresponds to each combination of 24 variables. so actually I have an equation with 24 variables and one result.&lt;br /&gt;
&lt;br /&gt;
so in excel I have one column which contains the 24 variables and the column next to it contains a figure which shows the result. what I need to do is to write loops to change the 24 variables between 1,2, and 3 and then record the result of the equation for each combination of 24 variables. I have written the loops (24 loops) and can record the result for each combination, what I have to do at this stage is to record the combinations which relates to each result. As there is only one result for each combination of 24 variables I was wondering whether I can tag each variable (in each cell) in a way that in the final sheet in the cell next to the result cell I can write for example 111123123111233311121232. This means that after each loop I am taking the values for each variable in 24 cells and put them all together in one cell in the final sheet. These variables are changing in each loop, the label should change as well after each loop so after the completion of the code I can find out which combination relates to which result.&lt;br /&gt;
&lt;br /&gt;
I have tried to define an array or matrix but i couldn't fix the problem.&lt;br /&gt;
&lt;br /&gt;
It would be great if you could give me a hint as I'm really short in time. &lt;br /&gt;
&lt;br /&gt;
This is the input sheet (the code changes the values in the cells in A column after each operation) &lt;br /&gt;
A    B&lt;br /&gt;
1    Result  &lt;br /&gt;
2&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
1&lt;br /&gt;
3&lt;br /&gt;
2&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
I want the output sheet to look like this: &lt;br /&gt;
&lt;br /&gt;
A         B&lt;br /&gt;
1211132   Result&lt;br /&gt;
&lt;br /&gt;
I want to put the values in the A column all together in one cell in A column in the output sheet. I should note that the values in column A input sheet are all variables. for example h1, h2, h3, h4 ... so I need a line in the code that for example: Range("A1").value=h1h2h3h4... i know that VBA does not understand it. How can I define this line so that after each operation the value in the cells in the A column (in the output sheet) changes automatically as the variables change.   &lt;br /&gt;
&lt;br /&gt;
I have attached an excel file with my macro in it. &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/393103/393103/tagging-or-labeling-variables/</guid>
      <pubDate>Wed, 01 Jul 2009 03:35:18 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>How to Use API Commands in PHP?</title>
      <link>http://www.programmersheaven.com/mb/vba/392751/392751/how-to-use-api-commands-in-php/</link>
      <description>hi,&lt;br /&gt;
&lt;br /&gt;
 I am creating an API using PHP and XML. I have been a API which is already in existence, but created for another client. But I want to use the same API commands in my new API that i am creating now. so, Please help me..........</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392751/392751/how-to-use-api-commands-in-php/</guid>
      <pubDate>Tue, 23 Jun 2009 21:27:48 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>find &amp; copy value in different sheets</title>
      <link>http://www.programmersheaven.com/mb/vba/392712/392712/find--copy-value-in-different-sheets/</link>
      <description>i have two sheets where i need to take in values in sheet2 to display in sheet1. instead of copy pasting, i want to create a macro since its easier.&lt;br /&gt;
&lt;br /&gt;
Sheet1:&lt;br /&gt;
&lt;br /&gt;
      A             B              C&lt;br /&gt;
1  KPI           Card          Paper&lt;br /&gt;
2  Income                &lt;br /&gt;
3  Losses                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sheet2:&lt;br /&gt;
&lt;br /&gt;
      A              B             C&lt;br /&gt;
1  KPI            Card           Paper&lt;br /&gt;
2  Income          12              13&lt;br /&gt;
3  Losses          9               5&lt;br /&gt;
&lt;br /&gt;
i need to display the numbers in Sheet1 but based on the following:&lt;br /&gt;
&lt;br /&gt;
if i click on the third cell in column B to get the value for income, the macro is supposed to read the value in col B row 1, find a match in sheet2's range &lt;br /&gt;
A1:C1, go back to sheet1 and read value in A3, find a match in sheet2's range A1:A3. if it satisfies both conditions, the value displayed in sheet1 will be retrieved from B2 in sheet2.&lt;br /&gt;
&lt;br /&gt;
any idea?&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=696"&gt;Sample.zip&lt;/a&gt; (1418 bytes | downloaded 5 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392712/392712/find--copy-value-in-different-sheets/</guid>
      <pubDate>Tue, 23 Jun 2009 01:41:15 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>problem while input numbers to a field</title>
      <link>http://www.programmersheaven.com/mb/vba/392706/392706/problem-while-input-numbers-to-a-field/</link>
      <description>&lt;br /&gt;
&lt;br /&gt;
Hi guys, i am new to this forum and new to Access 07 and VBA&lt;br /&gt;
&lt;br /&gt;
i need to a custom msg if someone enters a dublicate number in a &lt;br /&gt;
&lt;br /&gt;
field in the form but i cant make it to work with the code bellow i&lt;br /&gt;
&lt;br /&gt;
 wont allow you to enter any new record.&lt;br /&gt;
&lt;br /&gt;
The form is Employee Table, Field N I N&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
thanks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Private Sub NIN_BeforeUpdate(Cancel As Integer)&lt;br /&gt;
&lt;br /&gt;
    Dim SID As String&lt;br /&gt;
    Dim stLinkCriteria As String&lt;br /&gt;
    Dim rsc As DAO.Recordset&lt;br /&gt;
&lt;br /&gt;
    Set rsc = Me.RecordsetClone&lt;br /&gt;
&lt;br /&gt;
    SID = Me.[N I N]&lt;br /&gt;
    stLinkCriteria = "[NIN]=" &amp;amp; "'" &amp;amp; SID &amp;amp; "'"&lt;br /&gt;
&lt;br /&gt;
    'Check Employee Table table for duplicate&lt;br /&gt;
    If DCount("NIN", "Employee Table", stLinkCriteria) &amp;gt; 0 Then&lt;br /&gt;
        'Undo duplicate entry&lt;br /&gt;
        Me.Undo&lt;br /&gt;
        'Message box warning of duplication&lt;br /&gt;
        MsgBox "Warning NIN Number " _&lt;br /&gt;
             &amp;amp; SID &amp;amp; " has already been entered." _&lt;br /&gt;
             &amp;amp; vbCr &amp;amp; vbCr &amp;amp; "You will now been taken to the record.", _&lt;br /&gt;
               vbInformation, "Duplicate Information"&lt;br /&gt;
        'Go to record of original record&lt;br /&gt;
        'rsc.FindFirst stLinkCriteria&lt;br /&gt;
        'Me.Bookmark = rsc.Bookmark&lt;br /&gt;
        &lt;br /&gt;
    End If&lt;br /&gt;
&lt;br /&gt;
    Set rsc = Nothing&lt;br /&gt;
    &lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392706/392706/problem-while-input-numbers-to-a-field/</guid>
      <pubDate>Tue, 23 Jun 2009 00:03:01 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>problem while input numbers to a field</title>
      <link>http://www.programmersheaven.com/mb/vba/392705/392705/problem-while-input-numbers-to-a-field/</link>
      <description>&lt;br /&gt;
&lt;br /&gt;
Hi guys, i am new to this forum and new to Access 07 and VBA&lt;br /&gt;
&lt;br /&gt;
i need to a custom msg if someone enters a dublicate number in a &lt;br /&gt;
&lt;br /&gt;
field in the form but i cant make it to work with the code bellow i&lt;br /&gt;
&lt;br /&gt;
 wont allow you to enter any new record.&lt;br /&gt;
&lt;br /&gt;
The form is Employee Table, Field N I N&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
thanks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Private Sub NIN_BeforeUpdate(Cancel As Integer)&lt;br /&gt;
&lt;br /&gt;
    Dim SID As String&lt;br /&gt;
    Dim stLinkCriteria As String&lt;br /&gt;
    Dim rsc As DAO.Recordset&lt;br /&gt;
&lt;br /&gt;
    Set rsc = Me.RecordsetClone&lt;br /&gt;
&lt;br /&gt;
    SID = Me.[N I N]&lt;br /&gt;
    stLinkCriteria = "[NIN]=" &amp;amp; "'" &amp;amp; SID &amp;amp; "'"&lt;br /&gt;
&lt;br /&gt;
    'Check Employee Table table for duplicate&lt;br /&gt;
    If DCount("NIN", "Employee Table", stLinkCriteria) &amp;gt; 0 Then&lt;br /&gt;
        'Undo duplicate entry&lt;br /&gt;
        Me.Undo&lt;br /&gt;
        'Message box warning of duplication&lt;br /&gt;
        MsgBox "Warning NIN Number " _&lt;br /&gt;
             &amp;amp; SID &amp;amp; " has already been entered." _&lt;br /&gt;
             &amp;amp; vbCr &amp;amp; vbCr &amp;amp; "You will now been taken to the record.", _&lt;br /&gt;
               vbInformation, "Duplicate Information"&lt;br /&gt;
        'Go to record of original record&lt;br /&gt;
        'rsc.FindFirst stLinkCriteria&lt;br /&gt;
        'Me.Bookmark = rsc.Bookmark&lt;br /&gt;
        &lt;br /&gt;
    End If&lt;br /&gt;
&lt;br /&gt;
    Set rsc = Nothing&lt;br /&gt;
    &lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392705/392705/problem-while-input-numbers-to-a-field/</guid>
      <pubDate>Tue, 23 Jun 2009 00:00:30 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Web query problem with java</title>
      <link>http://www.programmersheaven.com/mb/vba/392532/392532/web-query-problem-with-java/</link>
      <description>Hi&lt;br /&gt;
&lt;br /&gt;
I'm a little bit new to VBA. I've been working on it for only about 2 weeks.&lt;br /&gt;
This problem doesn't seem like a VBA problem.But i just think that maybe VBA could solve my problem.&lt;br /&gt;
&lt;br /&gt;
The thing is, I wish to import data from this web -&lt;br /&gt;
&lt;a href="http://www.tfex.co.th/tfex/dailyMarketReport.html"&gt;http://www.tfex.co.th/tfex/dailyMarketReport.html&lt;/a&gt;&lt;br /&gt;
Your shouldn't be able to read it because it's in Thai.&lt;br /&gt;
But here's the deal, if you scroll to the last table of the page, &lt;br /&gt;
you should see something like "SET50 Index Call Options". At the &lt;br /&gt;
bottom of the table, there are some links which type in Thai ,but&lt;br /&gt;
I think you could see as something like this -- "ก.ย.52","ธ.ค.52"&lt;br /&gt;
,"มี.ค.53" (they're month and year in Thai). Now, this links actually&lt;br /&gt;
contain Java script, so if I open one of these links the table contain&lt;br /&gt;
data in each month and year appear leaving NOTHING CHANGE WITH THE URL&lt;br /&gt;
IN THE ADDRESS BAR. So, I want to get all those data (from every month&lt;br /&gt;
and year) but I can't get it done with "Web Query" in "Import external&lt;br /&gt;
data".&lt;br /&gt;
&lt;br /&gt;
Do you have any suggestion on that??&lt;br /&gt;
&lt;br /&gt;
Thanks in advance... ^o^&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392532/392532/web-query-problem-with-java/</guid>
      <pubDate>Fri, 19 Jun 2009 04:20:52 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Delete Excel sheet without prompt</title>
      <link>http://www.programmersheaven.com/mb/vba/392511/392511/delete-excel-sheet-without-prompt/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I've written a procedure to delete a large number of sheets from an Excel workbook (Excel 2002) and am wondering if anyone can help me with code that will prevent the prompt comping up "Data may exist.. To permanently delete the Data, press Delete?"&lt;br /&gt;
&lt;br /&gt;
I want to avoid the user having to sit there pressing Delete heaps of times.&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392511/392511/delete-excel-sheet-without-prompt/</guid>
      <pubDate>Thu, 18 Jun 2009 16:35:48 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Point to pixel conversion in Excel VBA</title>
      <link>http://www.programmersheaven.com/mb/vba/392496/392496/point-to-pixel-conversion-in-excel-vba/</link>
      <description>I'm using VBA 6.5 in Excel V11.8307 and am wondering if there are any functions/methods that can be invoked to do a point to pixel conversion (or vice versa) when a point is selected on a series on a sheet chart. I want to be able to draw a horizontal line through the user selected point and then after all desired lines have been added (and perhaps moved and/or deleted), retrieve the x,y coordinates of the points where the horizontal lines intersect the series (data) line, in the data coordinate system. Are these methods/functions available only in newer versions of Excel?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Paul Hudgens&lt;br /&gt;
Denver&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392496/392496/point-to-pixel-conversion-in-excel-vba/</guid>
      <pubDate>Thu, 18 Jun 2009 13:55:10 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>How to use Crystal Reports 10.2 in VB 6 application</title>
      <link>http://www.programmersheaven.com/mb/vba/392196/392196/how-to-use-crystal-reports-102-in-vb-6-application/</link>
      <description>Hi I am a newbie to both VB 6 and CR 10.2&lt;br /&gt;
My task is to make changes in a report developed by earlier version of Crystal Reports. I edited the report using the Visual Studio 2005 IDE, but the edited report is not being recognised by the VB6 application . It throws an eror "Invalid TLV Record". Is there any way I can change my VB6 app to use CR 10.2. what dll's should I use to do this? Can any one please send me a sample code of how to  use CR 10.2 report in the VB6 application? &lt;br /&gt;
&lt;br /&gt;
PS: I cant upgrade the VB6 App to .net&lt;br /&gt;
I dont have exact version Crystal Reports Editor.&lt;br /&gt;
&lt;br /&gt;
please help.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
Ramesh.. &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/392196/392196/how-to-use-crystal-reports-102-in-vb-6-application/</guid>
      <pubDate>Thu, 11 Jun 2009 09:03:49 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>link a find button to the listbox</title>
      <link>http://www.programmersheaven.com/mb/vba/391973/391973/link-a-find-button-to-the-listbox/</link>
      <description>I am using excel 2003 vba.I want to complete a project only left link a &lt;br /&gt;
find button and a listbox, so when i type a name in the textbox1 the listbox &lt;br /&gt;
is populated with all the data to the respetive field so i can chose what &lt;br /&gt;
record of that person to updated.&lt;br /&gt;
&lt;br /&gt;
any problem or question send me a email to josephpagan@hotmail.com or do a reply. Please help complete this project.this url is for download the project in ecxel:&lt;br /&gt;
&lt;a href="http://www.4shared.com/file/110174178/b97258ed/forma_3.html"&gt;http://www.4shared.com/file/110174178/b97258ed/forma_3.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391973/391973/link-a-find-button-to-the-listbox/</guid>
      <pubDate>Fri, 05 Jun 2009 13:22:55 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Find text then cut and paste in same worksheet</title>
      <link>http://www.programmersheaven.com/mb/vba/391841/391841/find-text-then-cut-and-paste-in-same-worksheet/</link>
      <description>Hi, sorry but I am a newbie at this so I hope someone can help me!&lt;br /&gt;
&lt;br /&gt;
I am trying to create an Excel macro that will do the following:&lt;br /&gt;
&lt;br /&gt;
1. Search a column for cells that contain specific text.&lt;br /&gt;
2. Cut the entire row.&lt;br /&gt;
3. Paste the cut row into row 2 of worksheet.&lt;br /&gt;
4. Repeat steps 1 to 3 until all reocrds containing the specific text are at the top of my sheet.&lt;br /&gt;
&lt;br /&gt;
I think I should be using a Do...Loop statement but for the life of me I can't work out exactly what to do.&lt;br /&gt;
&lt;br /&gt;
Any guidance would be greatly appreciated.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391841/391841/find-text-then-cut-and-paste-in-same-worksheet/</guid>
      <pubDate>Tue, 02 Jun 2009 04:38:53 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>EXCEL communicating with hyperterminal</title>
      <link>http://www.programmersheaven.com/mb/vba/391835/391835/excel-communicating-with-hyperterminal/</link>
      <description>&lt;span style="font-size: medium;"&gt;hi, &lt;br /&gt;
&lt;br /&gt;
i am trying to cause information gathered through the hyperterminal communication connection (COM1) at windows XP (office 2003), to flow into an Excel sheet. &lt;br /&gt;
&lt;br /&gt;
is it possible to create using VBA code at the excel prog.? &lt;br /&gt;
&lt;br /&gt;
does anyone have a similar vba code?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
may the schwartz be with you,&lt;br /&gt;
&lt;br /&gt;
itays &lt;/span&gt;&lt;span style="color: Black;"&gt;&lt;/span&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391835/391835/excel-communicating-with-hyperterminal/</guid>
      <pubDate>Tue, 02 Jun 2009 01:59:48 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>System.InvalidOperationException was unhandled</title>
      <link>http://www.programmersheaven.com/mb/vba/391769/391769/systeminvalidoperationexception-was-unhandled/</link>
      <description>I'm stuck on this problem.  Any assistance will be welcome.  I've no problem sharing the code and/or project if needed.&lt;br /&gt;
&lt;br /&gt;
System.InvalidOperationException was unhandled&lt;br /&gt;
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Value cannot be null.\r\nParameter name: path"&lt;br /&gt;
  Source="Tin Can"&lt;br /&gt;
  StackTrace:&lt;br /&gt;
       at FreakishNoteGenerator.My.MyProject.MyForms.Create_
_Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190&lt;br /&gt;
       at FreakishNoteGenerator.My.MyProject.MyForms.get_for
m1()&lt;br /&gt;
       at FreakishNoteGenerator.My.MyApplication.OnCreateMai
nForm() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\My Project\Application.Designer.vb:line 35&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.OnRun()&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.DoApplicationModel()&lt;br /&gt;
       at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.Run(String[] commandLine)&lt;br /&gt;
       at FreakishNoteGenerator.My.MyApplication.Main(String
[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81&lt;br /&gt;
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)&lt;br /&gt;
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;br /&gt;
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)&lt;br /&gt;
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss
embly()&lt;br /&gt;
       at System.Runtime.Hosting.ApplicationActivator.Create
Instance(ActivationContext activationContext, String[] activationCustomData)&lt;br /&gt;
       at System.Runtime.Hosting.ApplicationActivator.Create
Instance(ActivationContext activationContext)&lt;br /&gt;
       at System.Activator.CreateInstance(ActivationContext activationContext)&lt;br /&gt;
       at Microsoft.VisualStudio.HostingProcess.HostProc.Run
UsersAssemblyDebugInZone()&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart_Context(
Object state)&lt;br /&gt;
       at System.Threading.ExecutionContext.Run(ExecutionCon
text executionContext, ContextCallback callback, Object state)&lt;br /&gt;
       at System.Threading.ThreadHelper.ThreadStart()&lt;br /&gt;
  InnerException: System.ArgumentNullException&lt;br /&gt;
       Message="Value cannot be null.\r\nParameter name: path"&lt;br /&gt;
       Source="mscorlib"&lt;br /&gt;
       ParamName="path"&lt;br /&gt;
       StackTrace:&lt;br /&gt;
            at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)&lt;br /&gt;
            at System.IO.StreamReader..ctor(String path)&lt;br /&gt;
            at FreakishNoteGenerator.Foundry.TBLoad() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.vb:line 143&lt;br /&gt;
            at FreakishNoteGenerator.Foundry.MasterLoadF() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.vb:line 37&lt;br /&gt;
            at FreakishNoteGenerator.Foundry.rbRep_CheckedChanged
(Object sender, EventArgs e) in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.vb:line 209&lt;br /&gt;
            at System.Windows.Forms.RadioButton.OnCheckedChanged(
EventArgs e)&lt;br /&gt;
            at System.Windows.Forms.RadioButton.set_Checked(Boole
an value)&lt;br /&gt;
            at FreakishNoteGenerator.Foundry.rbRep_CheckedChanged
(Object sender, EventArgs e) in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.vb:line 207&lt;br /&gt;
            at System.Windows.Forms.RadioButton.OnCheckedChanged(
EventArgs e)&lt;br /&gt;
            at System.Windows.Forms.RadioButton.set_Checked(Boole
an value)&lt;br /&gt;
            at FreakishNoteGenerator.Foundry.InitializeComponent(
) in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.Designer.vb:lin
e 113&lt;br /&gt;
            at FreakishNoteGenerator.Foundry..ctor() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\Foundry.vb:line 16&lt;br /&gt;
            at FreakishNoteGenerator.LoginForm..ctor() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\LoginForm.vb:line 5&lt;br /&gt;
            at FreakishNoteGenerator.form1..ctor() in C:\Documents and Settings\403803\Desktop\Desktop Holder\Tin Can Sup 1.3 code\FreakishNoteGenerator\form1.vb:line 22&lt;br /&gt;
       InnerException: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391769/391769/systeminvalidoperationexception-was-unhandled/</guid>
      <pubDate>Sun, 31 May 2009 09:24:05 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Please help me in EMU 8086 !!!!</title>
      <link>http://www.programmersheaven.com/mb/vba/391251/391251/please-help-me-in-emu-8086-/</link>
      <description>Modify the program to add the following features:&lt;br /&gt;
A header with the name of the program and a brief instruction for the user (the person learning to type);&lt;br /&gt;
At the end of the sentence, after pressing “enter” (carriage return), a counter will indicate the number of errors made;&lt;br /&gt;
At the end of each sentence, after displaying the number of errors, the program will ask the user whether he/she would like to have more exercise. If yes, proceed to the next sentence (prepare at least 10 different sentences).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
org 100h&lt;br /&gt;
&lt;br /&gt;
; set video mode    &lt;br /&gt;
mov ax, 3     ; text mode 80x25, 16 colors, 8 pages (ah=0, al=3)&lt;br /&gt;
int 10h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; main program body&lt;br /&gt;
&lt;br /&gt;
start:&lt;br /&gt;
    mov dx, offset msg&lt;br /&gt;
    mov ah, 9&lt;br /&gt;
    int 21h&lt;br /&gt;
    mov ah, 0Eh&lt;br /&gt;
    mov al, 0Ah&lt;br /&gt;
    int 10h         ; new line&lt;br /&gt;
&lt;br /&gt;
    mov bp, offset msg    &lt;br /&gt;
    &lt;br /&gt;
next_char:&lt;br /&gt;
    mov al, [bp]&lt;br /&gt;
    cmp al, 24h     ; '$'&lt;br /&gt;
    jne skip&lt;br /&gt;
    inc bp&lt;br /&gt;
    mov al, [bp]&lt;br /&gt;
skip:&lt;br /&gt;
    cmp al, 00h&lt;br /&gt;
    je  end_prog&lt;br /&gt;
    mov bl, al&lt;br /&gt;
input:&lt;br /&gt;
    mov ah, 0&lt;br /&gt;
    int 16h&lt;br /&gt;
    cmp bl, al&lt;br /&gt;
    jne input&lt;br /&gt;
    mov ah, 0Eh&lt;br /&gt;
    int 10h&lt;br /&gt;
    inc bp&lt;br /&gt;
    jmp next_char          &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
end_prog:&lt;br /&gt;
ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
msg db "The quick brown fox jumps right over the lazy dog.",0Dh,'$',00h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391251/391251/please-help-me-in-emu-8086-/</guid>
      <pubDate>Wed, 20 May 2009 09:23:02 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Access/Outlook automation error</title>
      <link>http://www.programmersheaven.com/mb/vba/391248/391248/accessoutlook-automation-error/</link>
      <description>Hi,&lt;br /&gt;
I have a database that downloads attachments from an outlook email folder; it's worked fine for about six months but now I get an automation error when I run it:&lt;br /&gt;
&lt;br /&gt;
"Method 'Attachments' of object 'MailItem' failed -2147221233"&lt;br /&gt;
&lt;br /&gt;
I have another database that does something similar and it has also started to receive the same error (code is below). I was wondering if a recent outlook update (or change to security settings?) might have caused this?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance for any help,&lt;br /&gt;
Gareth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dim Ns As NameSpace&lt;br /&gt;
Dim myF As MAPIFolder&lt;br /&gt;
Dim miItem As Object&lt;br /&gt;
Dim Ol As New Outlook.Application&lt;br /&gt;
Dim Atmt As Attachment&lt;br /&gt;
Dim miProperty As Property&lt;br /&gt;
Dim FileName As String&lt;br /&gt;
Dim i As Integer&lt;br /&gt;
Dim x As Integer&lt;br /&gt;
&lt;br /&gt;
On Error GoTo ErrDload&lt;br /&gt;
Set Ns = Ol.GetNamespace("MAPI")&lt;br /&gt;
&lt;br /&gt;
Set myF = Ns.PickFolder&lt;br /&gt;
DownloadMail = False&lt;br /&gt;
&lt;br /&gt;
If myF.Items.Count = 0 Then&lt;br /&gt;
    Exit Function&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
 For Each miItem In myF.Items&lt;br /&gt;
    If InStr(1, miItem.Subject, "Alert") Then&lt;br /&gt;
        Debug.Print miItem.Subject&lt;br /&gt;
        For Each Atmt In miItem.Attachments&lt;br /&gt;
            FileName = IMPORTPATH &amp;amp; Atmt.FileName&lt;br /&gt;
            Atmt.SaveAsFile FileName&lt;br /&gt;
            i = i + 1&lt;br /&gt;
        Next Atmt&lt;br /&gt;
    End If&lt;br /&gt;
 Next miItem&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391248/391248/accessoutlook-automation-error/</guid>
      <pubDate>Wed, 20 May 2009 07:54:17 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Excel VBA Send Email Error!</title>
      <link>http://www.programmersheaven.com/mb/vba/391205/391205/excel-vba-send-email-error/</link>
      <description>Hello.&lt;br /&gt;
&lt;br /&gt;
I have a VBA program that is supposed to Send a Selection from an excel workbook to hard coded email addresses.It is set up to run every morning at 8am. It never errors when I just run it but once I put it into production every fourth day I recieve the following error:&lt;br /&gt;
&lt;br /&gt;
'Application error:&lt;br /&gt;
The instruction at "0x6508cb2a referenced memory at "0x00000008." The memory could not be read.'&lt;br /&gt;
&lt;br /&gt;
Below is my code:&lt;br /&gt;
&lt;br /&gt;
Sub Selection()&lt;br /&gt;
Application.OnTime TimeValue("08:00:00"), "Selection"&lt;br /&gt;
    Dim rng1 As Range&lt;br /&gt;
    Dim dateToFind As Date&lt;br /&gt;
    Dim foundDate As Range&lt;br /&gt;
    Dim Source As Range&lt;br /&gt;
    Dim OutApp As Object&lt;br /&gt;
    Dim OutMail As Object&lt;br /&gt;
    Dim StrBody As String&lt;br /&gt;
    &lt;br /&gt;
    With Application&lt;br /&gt;
        .EnableEvents = False&lt;br /&gt;
        .ScreenUpdating = False&lt;br /&gt;
    End With&lt;br /&gt;
    &lt;br /&gt;
dateToFind = CLng(Date)&lt;br /&gt;
&lt;br /&gt;
With Sheets("Sheet1").Range("A:G")&lt;br /&gt;
Set foundDate = .Find(What:=dateToFind, _&lt;br /&gt;
                        After:=.Cells(.Cells.Count), _&lt;br /&gt;
                        LookIn:=xlFormulas, _&lt;br /&gt;
                        LookAt:=xlWhole, _&lt;br /&gt;
                        SearchOrder:=xlByRows, _&lt;br /&gt;
                        SearchDirection:=xlNext, _&lt;br /&gt;
                        MatchCase:=False)&lt;br /&gt;
        If Not foundDate Is Nothing Then&lt;br /&gt;
            Application.Goto foundDate, True&lt;br /&gt;
        Else&lt;br /&gt;
            MsgBox "Nothing found"&lt;br /&gt;
        End If&lt;br /&gt;
    End With&lt;br /&gt;
&lt;br /&gt;
ActiveCell.Select&lt;br /&gt;
Set TopCell = ActiveCell&lt;br /&gt;
Set BottomCell = Cells(ActiveCell.Row + 29, ActiveCell.Column)&lt;br /&gt;
Range(TopCell, BottomCell).Select&lt;br /&gt;
&lt;br /&gt;
    Set Source = Nothing&lt;br /&gt;
    On Error Resume Next&lt;br /&gt;
    Set Source = Range(TopCell, BottomCell)&lt;br /&gt;
    On Error GoTo 0&lt;br /&gt;
&lt;br /&gt;
    If Source Is Nothing Then&lt;br /&gt;
        MsgBox "The selection is not a range or the sheet is protected" &amp;amp; _&lt;br /&gt;
               vbNewLine &amp;amp; "please correct and try again.", vbOKOnly&lt;br /&gt;
        Exit Sub&lt;br /&gt;
    End If&lt;br /&gt;
&lt;br /&gt;
    Set OutApp = CreateObject("Outlook.Application")&lt;br /&gt;
    OutApp.Session.Logon&lt;br /&gt;
    Set OutMail = OutApp.CreateItem(0)&lt;br /&gt;
&lt;br /&gt;
    On Error Resume Next&lt;br /&gt;
    StrBody = "Below is the Cross Functional Production schedule for today.  Please note that if there is a problem with production, a notification will be sent." &amp;amp; "&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;"&lt;br /&gt;
    With OutMail&lt;br /&gt;
        .To = "ewheet2@uic.edu"&lt;br /&gt;
        .CC = ""&lt;br /&gt;
        .BCC = ""&lt;br /&gt;
        .Subject = "Today's Production Calendar"&lt;br /&gt;
        .HTMLBody = StrBody &amp;amp; RangetoHTML(Source)&lt;br /&gt;
        .Send   'or .Display&lt;br /&gt;
    End With&lt;br /&gt;
    On Error GoTo 0&lt;br /&gt;
&lt;br /&gt;
    With Application&lt;br /&gt;
        .EnableEvents = True&lt;br /&gt;
        .ScreenUpdating = True&lt;br /&gt;
    End With&lt;br /&gt;
&lt;br /&gt;
    Set OutMail = Nothing&lt;br /&gt;
    Set OutApp = Nothing&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Function RangetoHTML(Source As Range)&lt;br /&gt;
    Dim fso As Object&lt;br /&gt;
    Dim ts As Object&lt;br /&gt;
    Dim TempFile As String&lt;br /&gt;
    Dim TempWB As Workbook&lt;br /&gt;
 &lt;br /&gt;
    TempFile = Environ$("temp") &amp;amp; "/" &amp;amp; Format(Now, "dd-mm-yy;;;\d\d\-\m\m\-\y\y") &amp;amp; ".htm"&lt;br /&gt;
 &lt;br /&gt;
    'Copy the range and create a new workbook to past the data in&lt;br /&gt;
    Source.Copy&lt;br /&gt;
    Set TempWB = Workbooks.Add(1)&lt;br /&gt;
    With TempWB.Sheets(1)&lt;br /&gt;
        .Cells(1).PasteSpecial Paste:=8&lt;br /&gt;
        .Cells(1).PasteSpecial xlPasteValues, , False, False&lt;br /&gt;
        .Cells(1).PasteSpecial xlPasteFormats, , False, False&lt;br /&gt;
        .Cells(1).Select&lt;br /&gt;
        Application.CutCopyMode = False&lt;br /&gt;
        On Error Resume Next&lt;br /&gt;
        .DrawingObjects.Visible = True&lt;br /&gt;
        .DrawingObjects.Delete&lt;br /&gt;
        On Error GoTo 0&lt;br /&gt;
    End With&lt;br /&gt;
 &lt;br /&gt;
    'Publish the sheet to a htm file&lt;br /&gt;
    With TempWB.PublishObjects.Add( _&lt;br /&gt;
         SourceType:=xlSourceRange, _&lt;br /&gt;
         Filename:=TempFile, _&lt;br /&gt;
         Sheet:=TempWB.Sheets(1).Name, _&lt;br /&gt;
         Source:=TempWB.Sheets(1).UsedRange.Address, _&lt;br /&gt;
         HtmlType:=xlHtmlStatic)&lt;br /&gt;
        .Publish (True)&lt;br /&gt;
    End With&lt;br /&gt;
 &lt;br /&gt;
    'Read all data from the htm file into RangetoHTML&lt;br /&gt;
    Set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)&lt;br /&gt;
    RangetoHTML = ts.ReadAll&lt;br /&gt;
    ts.Close&lt;br /&gt;
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _&lt;br /&gt;
                          "align=left x:publishsource=")&lt;br /&gt;
 &lt;br /&gt;
    'Close TempWB&lt;br /&gt;
    TempWB.Close savechanges:=False&lt;br /&gt;
 &lt;br /&gt;
    'Delete the htm file we used in this function&lt;br /&gt;
    Kill TempFile&lt;br /&gt;
 &lt;br /&gt;
    Set ts = Nothing&lt;br /&gt;
    Set fso = Nothing&lt;br /&gt;
    Set TempWB = Nothing&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please help!&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/391205/391205/excel-vba-send-email-error/</guid>
      <pubDate>Tue, 19 May 2009 09:28:34 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Please Help  Excel vba  Loop  question</title>
      <link>http://www.programmersheaven.com/mb/vba/390953/390953/please-help--excel-vba--loop--question/</link>
      <description>I can't seem to figure out the better way to code a loop.  &lt;br /&gt;
Please help  Thank you,  JB&lt;br /&gt;
&lt;br /&gt;
  Long n short of it, code I'm using is below:&lt;br /&gt;
  from row 3 and below (col a is input area):  b=a *(row1 coL b), c=b*(row1 coL c), d=c*(row1 coL d), e=d*(row1 coL e)&lt;br /&gt;
&lt;br /&gt;
 amount of Columns are fixed&lt;br /&gt;
 amount of Rows are variable&lt;br /&gt;
&lt;br /&gt;
       a           b         c          d        e&lt;br /&gt;
1 .               .03      .00       .03      .07&lt;br /&gt;
2 .  2008     2009    2010     2011   2012&lt;br /&gt;
 &lt;br /&gt;
3 .  1          1.03     1.03     1.06     1.14       &lt;br /&gt;
4 .  3          3.09     3.09     3.18     3.41&lt;br /&gt;
5 .  2          2.06     2.06     2.12     2.27&lt;br /&gt;
6 .  5          5.15     5.15     5.30     5.68      &lt;br /&gt;
   so on....&lt;br /&gt;
Total        11.0    11.3     11.7    12.5&lt;br /&gt;
&lt;br /&gt;
I activate the following by a 'Worksheet Change' in input column.&lt;br /&gt;
&lt;br /&gt;
Sub calculationMFI()&lt;br /&gt;
 Dim ciL As Range&lt;br /&gt;
 Dim lr0 As Long&lt;br /&gt;
 Dim lc1 As Long&lt;br /&gt;
  Application.ScreenUpdating = False&lt;br /&gt;
  Application.Calculation = xlCalculationManual&lt;br /&gt;
   On Error Resume Next&lt;br /&gt;
    lr0 = 0&lt;br /&gt;
    lc1 = 1&lt;br /&gt;
   For Each ciL In Sheet1.Range("H5:AA5")&lt;br /&gt;
                        ciL.Offset(lr0, lc1).Value = ciL.Offset(lr0, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 1, lc1).Value = ciL.Offset(lr0 + 1, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 1, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 2, lc1).Value = ciL.Offset(lr0 + 2, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 2, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 3, lc1).Value = ciL.Offset(lr0 + 3, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 3, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 4, lc1).Value = ciL.Offset(lr0 + 4, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 4, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 5, lc1).Value = ciL.Offset(lr0 + 5, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 5, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 6, lc1).Value = ciL.Offset(lr0 + 6, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 6, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 7, lc1).Value = ciL.Offset(lr0 + 7, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 7, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 8, lc1).Value = ciL.Offset(lr0 + 8, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 8, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 9, lc1).Value = ciL.Offset(lr0 + 9, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 9, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 10, lc1).Value = ciL.Offset(lr0 + 10, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 10, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 11, lc1).Value = ciL.Offset(lr0 + 11, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 11, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 12, lc1).Value = ciL.Offset(lr0 + 12, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 12, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 13, lc1).Value = ciL.Offset(lr0 + 13, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 13, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 14, lc1).Value = ciL.Offset(lr0 + 14, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 14, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 15, lc1).Value = ciL.Offset(lr0 + 15, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 15, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 16, lc1).Value = ciL.Offset(lr0 + 16, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 16, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 17, lc1).Value = ciL.Offset(lr0 + 17, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 17, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 18, lc1).Value = ciL.Offset(lr0 + 18, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 18, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 19, lc1).Value = ciL.Offset(lr0 + 19, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 19, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 20, lc1).Value = ciL.Offset(lr0 + 20, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 20, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 21, lc1).Value = ciL.Offset(lr0 + 21, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 21, 0)                        ciL.Offset(lr0 + 22, lc1).Value = ciL.Offset(lr0 + 22, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 22, 0)                        ciL.Offset(lr0 + 23, lc1).Value = ciL.Offset(lr0 + 23, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 23, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 24, lc1).Value = ciL.Offset(lr0 + 24, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 24, 0)&lt;br /&gt;
                        ciL.Offset(lr0 + 25, lc1).Value = ciL.Offset(lr0 + 25, 0) * ciL.Offset(-3, lc1) + ciL.Offset(lr0 + 25, 0)&lt;br /&gt;
  Next&lt;br /&gt;
Application.Calculation = xlCalculationAutomatic&lt;br /&gt;
Application.ScreenUpdating = True&lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/390953/390953/please-help--excel-vba--loop--question/</guid>
      <pubDate>Wed, 13 May 2009 16:00:10 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Tab delimited Text into Excel using VBA</title>
      <link>http://www.programmersheaven.com/mb/vba/390404/390404/tab-delimited-text-into-excel-using-vba/</link>
      <description>&lt;br /&gt;
I am building a basic program that requires excel to read and import data from a tab delimited notepad file onto a worksheet.  The notepad file has 5 columns with a sample line looking like this:&lt;br /&gt;
 &lt;br /&gt;
YM    SELL    127    12600.25     1/2/2009&lt;br /&gt;
 &lt;br /&gt;
My code is below. I think I am either:&lt;br /&gt;
     1.) Assinging the data types incorrectly&lt;br /&gt;
     2.) Starting each parse from the 1st column (column 'A') of every line of the text file instead of column A, B, C, D, or E (columns 1-5 on the text file respectively) because it gives me an "over flow error."  &lt;br /&gt;
     OR 3.) Both&lt;br /&gt;
 &lt;br /&gt;
No one online seems to be able to answer this question, but I feel like I am making a stupid mistake that an expert would be able to notice.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Sub ReadTextFile()&lt;br /&gt;
  Dim A    As String * 2, B  As String * 4, C As Integer, D As Single, E As Date&lt;br /&gt;
  Dim iRow    As Long&lt;br /&gt;
  Dim Fname   As Variant&lt;br /&gt;
  Fname = Application.GetOpenFilename("Text Files (*.txt),*.txt", , _&lt;br /&gt;
           "Select Text Data File")&lt;br /&gt;
  If Fname = False Then Exit Sub&lt;br /&gt;
&lt;br /&gt;
  Open Fname For Input As #1&lt;br /&gt;
  iRow = 1&lt;br /&gt;
  Do While Not EOF(1)&lt;br /&gt;
     Input #1, A, B, C, D, E&lt;br /&gt;
     Cells(iRow, 1) = A&lt;br /&gt;
     Cells(iRow, 1) = B&lt;br /&gt;
     Cells(iRow, 1) = C&lt;br /&gt;
     Cells(iRow, 1) = D&lt;br /&gt;
     Cells(iRow, 1) = E&lt;br /&gt;
     iRow = iRow + 1&lt;br /&gt;
  Loop&lt;br /&gt;
  Close 1&lt;br /&gt;
End Sub&lt;br /&gt;
 &lt;br /&gt;
 I would greatly appreciate any insight you might have!&lt;br /&gt;
 &lt;br /&gt;
Thanks,&lt;br /&gt;
Dave&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/390404/390404/tab-delimited-text-into-excel-using-vba/</guid>
      <pubDate>Mon, 04 May 2009 17:43:19 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Automation Error -2147417843 in ActiveX component</title>
      <link>http://www.programmersheaven.com/mb/vba/390352/390352/automation-error--2147417843-in-activex-component/</link>
      <description>Hi All&lt;br /&gt;
&lt;br /&gt;
I trying to write an automation script to screen scrape a 3rd Party VB6 application.&lt;br /&gt;
&lt;br /&gt;
I am having difficulty trying to enter in data in an ActiveX Masked Edit Control (textbox).&lt;br /&gt;
&lt;br /&gt;
When I try using&lt;br /&gt;
call SendMessage(myHwnd1,&amp;amp;HC,0,"String")&lt;br /&gt;
&lt;br /&gt;
I get an Automation Error&lt;br /&gt;
"An outgoing call can not be made since the application is dispatching an input synchronous call"&lt;br /&gt;
&lt;br /&gt;
I have looked up the MSDN forums and knowledge base and it suggests using timers but I have tried that and it didn't make any difference.&lt;br /&gt;
&lt;br /&gt;
I have tried using other Win32 API such as SetWindowText but that didn't work for obvivous reasons.&lt;br /&gt;
&lt;br /&gt;
Does anyone know how to enter data into an activeX component using VBA and Win32 API calls and not get the automation error?&lt;br /&gt;
&lt;br /&gt;
Kind Regards&lt;br /&gt;
Charles						  &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/390352/390352/automation-error--2147417843-in-activex-component/</guid>
      <pubDate>Mon, 04 May 2009 00:34:27 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>VBA auto naming when saving files</title>
      <link>http://www.programmersheaven.com/mb/vba/390198/390198/vba-auto-naming-when-saving-files/</link>
      <description>I could do with some help, i've created a short macro that basically rearranges and calculates a large table of data and then saves the new file. Is there anyway to code the macro so that it saves the new file as the old file name . Currently it always saves the output as book 1. Which is annoying as i have to run this file several times.&lt;br /&gt;
&lt;br /&gt;
Any help/Advice would be much appreciated.  &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/390198/390198/vba-auto-naming-when-saving-files/</guid>
      <pubDate>Fri, 01 May 2009 01:44:35 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>How to create and track a unique number with vba</title>
      <link>http://www.programmersheaven.com/mb/vba/389779/389779/how-to-create-and-track-a-unique-number-with-vba/</link>
      <description>I have a database that I use a function to create inspection report number by setting the date in a specific format and extension number on the end.  Here is what I have so far:&lt;br /&gt;
&lt;br /&gt;
Public Function NextAutoNum() As String&lt;br /&gt;
    Dim I As Integer&lt;br /&gt;
    Dim D As Date&lt;br /&gt;
    Dim MySQL As String&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
       &lt;br /&gt;
    D = DLookup("[LastDate]", "tblICNNumber")&lt;br /&gt;
    I = DLookup("[LastNumber]", "tblICNNumber")&lt;br /&gt;
    If D = Date Then&lt;br /&gt;
        I = I + 1&lt;br /&gt;
    Else&lt;br /&gt;
        D = Date&lt;br /&gt;
        I = 1&lt;br /&gt;
    End If&lt;br /&gt;
    &lt;br /&gt;
    MySQL = "Update tblICNNumber SET[LastDate] = Date()"&lt;br /&gt;
    CurrentDb.Execute MySQL&lt;br /&gt;
    MySQL = "Update tblICNNumber SET[LastNumber] = " &amp;amp; I &amp;amp; ""&lt;br /&gt;
    CurrentDb.Execute MySQL&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    NextAutoNum = Format$(Year(D), "0000") &amp;amp; Format$(Month(D), "00") &amp;amp; Format$(Day(D), "00") &amp;amp; "-" &amp;amp; Format$(I, "000")&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
It will give me an inspection number in a format such as 20090424-001 for the first inspection conducted on the 24th of April. It works great as longer as inspections are inputted on time, but if a inspection is inputted several days later, I don't know how to draw the last extension number inputted on the previous date.  I could just continue to assign the control corresponding to the date the inspection was inputted, but I would like to have the control correspond to the date the inspection was performed.  Any ideas??? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/389779/389779/how-to-create-and-track-a-unique-number-with-vba/</guid>
      <pubDate>Fri, 24 Apr 2009 15:17:22 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Emailing from excel via Outlook contact list</title>
      <link>http://www.programmersheaven.com/mb/vba/389698/389698/emailing-from-excel-via-outlook-contact-list/</link>
      <description>I need to change a macro that sends email from excel through lotus notes. Now we have switched to Outlook so it needs a little adjustment but I'm not sure how, if anyone can help me that would be fantastic! The code has something abt username and password I dont think thts necessary for Outlook is it?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dim Maildb As Object 'The mail database&lt;br /&gt;
    Dim UserName As String 'The current users notes name&lt;br /&gt;
    Dim MailDbName As String 'THe current users notes mail database name&lt;br /&gt;
    Dim MailDoc As Object 'The mail document itself&lt;br /&gt;
    Dim AttachME As Object 'The attachment richtextfile object&lt;br /&gt;
    Dim Session As Object 'The notes session&lt;br /&gt;
    Dim EmbedObj As Object 'The embedded object (Attachment)&lt;br /&gt;
 'Start a session to notes&lt;br /&gt;
    Set Session = CreateObject("Notes.NotesSession") &lt;br /&gt;
 'Next line only works with 5.x and above. Replace password with your password&lt;br /&gt;
 ' Session.Initialize ("password")&lt;br /&gt;
 'Get the sessions username and then calculate the mail file name&lt;br /&gt;
 &lt;br /&gt;
    UserName = Session.UserName &lt;br /&gt;
    MailDbName = Left$(UserName, 1) &amp;amp; Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) &amp;amp; ".nsf" &lt;br /&gt;
 'Open the mail database in notes&lt;br /&gt;
    Set Maildb = Session.GetDatabase("", MailDbName) &lt;br /&gt;
     If Maildb.IsOpen = True Then &lt;br /&gt;
 'Already open for mail&lt;br /&gt;
     Else &lt;br /&gt;
         Maildb.OPENMAIL &lt;br /&gt;
     End If &lt;br /&gt;
 'Set up the new mail document&lt;br /&gt;
    Set MailDoc = Maildb.CreateDocument &lt;br /&gt;
    MailDoc.Form = "Memo" &lt;br /&gt;
    MailDoc.sendto = mail2 &lt;br /&gt;
    MailDoc.Subject = " COM trades " &amp;amp; tag1 &amp;amp; Chr(32) &amp;amp; Sheet1.Range("B19") &lt;br /&gt;
    MailDoc.body = strbody &lt;br /&gt;
    MailDoc.SaveMessageOnSend = saveit &lt;br /&gt;
 &lt;br /&gt;
    MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder&lt;br /&gt;
    MailDoc.send 0, Recipient &lt;br /&gt;
 'Clean Up&lt;br /&gt;
    Set Maildb = Nothing &lt;br /&gt;
    Set MailDoc = Nothing &lt;br /&gt;
    Set AttachME = Nothing &lt;br /&gt;
    Set Session = Nothing &lt;br /&gt;
    Set EmbedObj = Nothing &lt;br /&gt;
    Next &lt;br /&gt;
    &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
End Sub &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/389698/389698/emailing-from-excel-via-outlook-contact-list/</guid>
      <pubDate>Thu, 23 Apr 2009 09:49:11 -0700</pubDate>
      <category>VBA</category>
    </item>
    <item>
      <title>Desperately Need excell cripting Help (very complicated)</title>
      <link>http://www.programmersheaven.com/mb/vba/389654/389654/desperately-need-excell-cripting-help-very-complicated/</link>
      <description>I'm developing this tool for work and I am stuck on how to implement what I need. See Attachment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somehow I need to be able to let people add and remove lines under each stage (B8:B14), esentially copy and insert a row and delete the row if needed.  &lt;br /&gt;
&lt;br /&gt;
So far I have managed to get two possible methods by modifying scripts I found on the web:  &lt;br /&gt;
&lt;br /&gt;
Button 1 (I8) will copy cells B2:B8 and insert wherever I have specified.  The problem is I don't know how I can force it to insert the copied cells under the corresponding stage.&lt;br /&gt;
&lt;br /&gt;
Button 2 (I9) will insert a row directly below the button without having to copy cells B2:B8, however it does not copy the formulas down and it also shifts the content in column J and K.&lt;br /&gt;
&lt;br /&gt;
Another problem I need addressed is how to remove the inserted lines if the user needs to.  What I wanted to do was add a checkbox in front of the newly inserted lines so that if selected the user could push the "Delete Checked" button in (I7) and it will delete the checked rows.&lt;br /&gt;
&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=606"&gt;ROM_SampleFinal.xls&lt;/a&gt; (93696 bytes | downloaded 21 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/vba/389654/389654/desperately-need-excell-cripting-help-very-complicated/</guid>
      <pubDate>Wed, 22 Apr 2009 15:57:46 -0700</pubDate>
      <category>VBA</category>
    </item>
  </channel>
</rss>