<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8208301773917930821</id><updated>2024-09-12T07:40:48.563-04:00</updated><category term="VBA"/><category term="excel"/><category term="firefox"/><category term="office"/><category term="VB6"/><category term="mario kart"/><category term="microsoft"/><category term="API"/><category term="Dir"/><category term="VBS"/><category term="gmail"/><category term="rant"/><category term="visual studio"/><category term="wii"/><category term="Enum"/><category term="FSO"/><category term="Folder"/><category term="Format"/><category term="InStrRev"/><category term="Recycling Bin"/><category term="RegExp"/><category term="Type"/><category term="addin"/><category term="adsense"/><category term="apple"/><category term="c"/><category term="const"/><category term="cygwin"/><category term="env2"/><category term="google"/><category term="guild wars"/><category term="instant messaging"/><category term="job"/><category term="menu"/><category term="mobile email"/><category term="mork"/><category term="mvp"/><category term="new computer"/><category term="pidgin"/><category term="plugin"/><category term="roc"/><category term="rss"/><category term="system tray"/><category term="training"/><category term="verizon wireless"/><category term="woot"/><category term="xp64"/><title type='text'>My life with and without Excel</title><subtitle type='html'>Just some random thoughts and discoveries. Original, I know.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-5477490418723265338</id><published>2008-06-19T08:18:00.002-04:00</published><updated>2008-06-19T08:20:12.170-04:00</updated><title type='text'>Wed-nosed weindeer</title><content type='html'>It is again time for a wootoff.. the first one since the last one&lt;br /&gt;&lt;br /&gt;For those of you who missed my &lt;a href=&quot;http://mvxl.blogspot.com/2008/05/wootoffs.html&quot; target=&quot;_blank&quot;&gt;previous post&lt;/a&gt; about wootoffs, now is your time to check that out&lt;br /&gt;&lt;br /&gt;I&#39;m busy at work, so I&#39;m hoping no BOC until this afternoon when I get home, but hopefully you can score one if it is sooner.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/5477490418723265338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/5477490418723265338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/5477490418723265338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/5477490418723265338'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/wed-nosed-weindeer.html' title='Wed-nosed weindeer'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-2729739024323687252</id><published>2008-06-16T10:14:00.000-04:00</published><updated>2008-06-16T10:17:05.238-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Format"/><category scheme="http://www.blogger.com/atom/ns#" term="InStrRev"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><category scheme="http://www.blogger.com/atom/ns#" term="VBS"/><title type='text'>VBScript - InStrRev and Format</title><content type='html'>Wow, big day for posts. Guess I am just waiting on a couple things; waiting to hear from the bigger boss about some more work for my transition (2 weeks left!) and waiting to hear from my love to see how her job interview went (could still be going on).  But do you really care about any of that? I do, but I doubt you do.  So I&#39;m gonna post something about vbscript, something I love and think that more people should get into as it is quite flexible.&lt;br /&gt;&lt;br /&gt;A very simple post to start out. For the most part, vbs can use the same methods and functions as vba/vb6, with slight modifications.  The two biggest things missing, in my opinion, are Format() and InStrRev().  You can make a substitute function in VBS for the latter, however the former needs a bit more work and usually specific to your task at hand.&lt;br /&gt;&lt;br /&gt;I&#39;ll get the easier one out of the way. I only use the two main arguments for this, but  you can easily add something for the start position or even comparison type.  If you want to use it, simply put this somewhere in your vbs file and call it as normal:&lt;br /&gt;&lt;pre&gt;Function InStrRev(ByVal vStringCheck, ByVal vStringMatch)&lt;br /&gt; Dim i, iLen&lt;br /&gt; iLen = Len(vStringMatch)&lt;br /&gt; For i = Len(vStringCheck) To 1 Step -1&lt;br /&gt;  If Mid(vStringCheck, i, iLen) = vStringMatch Then Exit For&lt;br /&gt; Next&lt;br /&gt; InStrRev = i&lt;br /&gt; Set i = Nothing&lt;br /&gt; Set iLen = Nothing&lt;br /&gt;End Function&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Simple, huh?&lt;br /&gt;Next is using Format in VBS. As I said, you can&#39;t just use the function like   Format(7, &quot;000&quot;)    as you can in VBA. What you can do, however, is manipulate strings to get it done easily (and use a function for it if you&#39;re going to do it multiple times). &lt;br /&gt;&lt;br /&gt;To see a one-shot version of it, here is how you would write the above Format statement in VBS. Note that you would probably never go through this much code to write &quot;007&quot;, but it should give you an idea of how it works. In essence, if you want it to be 3 digits, you&#39;re concatenating &quot;000&quot; to the value &quot;7&quot;, then taking the right 3 digits of it:&lt;pre&gt; Dim TheValue, NumDigits, PaddedValue&lt;br /&gt; TheValue = 7&lt;br /&gt; NumDigits = 3&lt;br /&gt; PaddedValue = Right(String(NumDigits, &quot;0&quot;) &amp; TheValue, NumDigits)&lt;br /&gt; MsgBox PaddedValue&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you plan to do this multiple times, heres an example of how to format the current date in mm/dd/yyyy formation:&lt;pre&gt; MsgBox FormatPaddedZeroes(Month(Now), 2) &amp; &quot;/&quot; &amp; FormatPaddedZeroes(Day(Now), 2) &amp; _&lt;br /&gt;  &quot;/&quot; &amp; FormatPaddedZeroes(Year(Now), 4)&lt;br /&gt;&lt;br /&gt;Function FormatPaddedZeroes(ByVal TheValue, ByVal NumDigits)&lt;br /&gt; FormatPaddedZeroes = Right(String(NumDigits, &quot;0&quot;) &amp; TheValue, NumDigits)&lt;br /&gt;End Function&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I could write a post on all the similarities between VBA and VBS, but other than a few things they are very similar (just remove any types in VBS, and the &#39;main&#39; subroutine doesn&#39;t need a Sub and End Sub).</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/2729739024323687252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/2729739024323687252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2729739024323687252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2729739024323687252'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/vbscript-instrrev-and-format.html' title='VBScript - InStrRev and Format'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-441562283865718281</id><published>2008-06-16T09:44:00.002-04:00</published><updated>2008-06-16T09:47:10.392-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Enum"/><category scheme="http://www.blogger.com/atom/ns#" term="Type"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>My VBA Enum and Type library</title><content type='html'>Ok, part 3 of 3 of my reference. This will contain all the Enum and Type statements I use; I take no credit for any of these (I don&#39;t believe) as I&#39;m sure I picked them up from others along the way, most likely MSDN.&lt;br /&gt;&lt;br /&gt;Enum:&lt;br /&gt;&lt;pre&gt;Public Enum SortOrder&lt;br /&gt;  SortAscending = 0&lt;br /&gt;  SortDescending = 1&lt;br /&gt;End Enum&lt;br /&gt;Public Enum RemoveFrom&lt;br /&gt;  RemoveArray = 0&lt;br /&gt;  RemoveIndex = 1&lt;br /&gt;End Enum&lt;br /&gt;Public Enum EOpenFile&lt;br /&gt;  OFN_READONLY = &amp;H1&lt;br /&gt;  OFN_OVERWRITEPROMPT = &amp;H2&lt;br /&gt;  OFN_HIDEREADONLY = &amp;H4&lt;br /&gt;  OFN_NOCHANGEDIR = &amp;H8&lt;br /&gt;  OFN_SHOWHELP = &amp;H10&lt;br /&gt;  OFN_ENABLEHOOK = &amp;H20&lt;br /&gt;  OFN_ENABLETEMPLATE = &amp;H40&lt;br /&gt;  OFN_ENABLETEMPLATEHANDLE = &amp;H80&lt;br /&gt;  OFN_NOVALIDATE = &amp;H100&lt;br /&gt;  OFN_ALLOWMULTISELECT = &amp;H200&lt;br /&gt;  OFN_EXTENSIONDIFFERENT = &amp;H400&lt;br /&gt;  OFN_PATHMUSTEXIST = &amp;H800&lt;br /&gt;  OFN_FILEMUSTEXIST = &amp;H1000&lt;br /&gt;  OFN_CREATEPROMPT = &amp;H2000&lt;br /&gt;  OFN_SHAREAWARE = &amp;H4000&lt;br /&gt;  OFN_NOREADONLYRETURN = &amp;H8000&amp;&lt;br /&gt;  OFN_NOTESTFILECREATE = &amp;H10000&lt;br /&gt;  OFN_NONETWORKBUTTON = &amp;H20000&lt;br /&gt;  OFN_NOLONGNAMES = &amp;H40000&lt;br /&gt;  OFN_EXPLORER = &amp;H80000&lt;br /&gt;  OFN_NODEREFERENCELINKS = &amp;H100000&lt;br /&gt;  OFN_LONGNAMES = &amp;H200000&lt;br /&gt;End Enum&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Type:&lt;br /&gt;&lt;pre&gt;Public Type OPENFILENAME&lt;br /&gt;  lStructSize As Long&lt;br /&gt;  hwndOwner As Long&lt;br /&gt;  hInstance As Long&lt;br /&gt;  lpstrFilter As String&lt;br /&gt;  lpstrCustomFilter As String&lt;br /&gt;  nMaxCustFilter As Long&lt;br /&gt;  nFilterIndex As Long&lt;br /&gt;  lpstrFile As String&lt;br /&gt;  nMaxFile As Long&lt;br /&gt;  lpstrFileTitle As String&lt;br /&gt;  nMaxFileTitle As Long&lt;br /&gt;  lpstrInitialDir As String&lt;br /&gt;  lpstrTitle As String&lt;br /&gt;  flags As Long&lt;br /&gt;  nFileOffset As Integer&lt;br /&gt;  nFileExtension As Integer&lt;br /&gt;  lpstrDefExt As String&lt;br /&gt;  lCustData As Long&lt;br /&gt;  lpfnHook As Long&lt;br /&gt;  lpTemplateName As String&lt;br /&gt;End Type&lt;br /&gt;Public Type BROWSEINFO&lt;br /&gt; hOwner As Long&lt;br /&gt; pidlRoot As Long&lt;br /&gt; pszDisplayName As String&lt;br /&gt; lpszTitle As String&lt;br /&gt; ulFlags As Long&lt;br /&gt; lpfn As Long&lt;br /&gt; lParam As Long&lt;br /&gt; iImage As Long&lt;br /&gt;End Type&lt;br /&gt;Public Type SECURITY_ATTRIBUTES&lt;br /&gt;  nLength                 As Long&lt;br /&gt;  lpSecurityDescription   As Long&lt;br /&gt;  bInheritHandle          As Boolean&lt;br /&gt;End Type&lt;br /&gt;Public Type FILETIME&lt;br /&gt;  dwLowDateTime As Long&lt;br /&gt;  dwHighDateTime As Long&lt;br /&gt;End Type&lt;br /&gt;Public Type WIN32_FIND_DATA&lt;br /&gt;  dwFileAttributes As Long&lt;br /&gt;  ftCreationTime As FILETIME&lt;br /&gt;  ftLastAccessTime As FILETIME&lt;br /&gt;  ftLastWriteTime As FILETIME&lt;br /&gt;  nFileSizeHigh As Long&lt;br /&gt;  nFileSizeLow As Long&lt;br /&gt;  dwReserved0 As Long&lt;br /&gt;  dwReserved1 As Long&lt;br /&gt;  cFileName As String * 218 &#39;MAX_PATH&lt;br /&gt;  cAlternate As String * 14&lt;br /&gt;End Type&lt;br /&gt;Type NOTIFYICONDATA&lt;br /&gt;  cbSize As Long&lt;br /&gt;  hwnd As Long&lt;br /&gt;  uID As Long&lt;br /&gt;  uFlags As Long&lt;br /&gt;  uCallbackMessage As Long&lt;br /&gt;  hIcon As Long&lt;br /&gt;  szTip As String * 64 &#39;MAX_TOOLTIP&lt;br /&gt;End Type&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/441562283865718281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/441562283865718281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/441562283865718281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/441562283865718281'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/my-vba-enum-and-type-library.html' title='My VBA Enum and Type library'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-768203630610970059</id><published>2008-06-16T09:42:00.003-04:00</published><updated>2008-06-16T09:44:21.211-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="const"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>VBA Const values</title><content type='html'>Part 2 of 3 of (my) reference posts.. These are less important to have handy than others, since in any language, a value is a value is a value. Easy enough to make a new const statement in VBA. However, these are the constants that my code library needs in order to compile, so I&#39;ll post it here :)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Public Const BIF_BROWSEFORCOMPUTER = &amp;H1000&lt;br /&gt;Public Const BIF_BROWSEFORPRINTER = &amp;H2000&lt;br /&gt;Public Const BIF_BROWSEINCLUDEFILES = &amp;H4000&lt;br /&gt;Public Const BIF_DONTGOBELOWDOMAIN = &amp;H2&lt;br /&gt;Public Const BIF_EDITBOX = &amp;H10&lt;br /&gt;Public Const BIF_NEWDIALOGSTYLE = &amp;H40&lt;br /&gt;Public Const BIF_RETURNFSANCESTORS = &amp;H8&lt;br /&gt;Public Const BIF_RETURNONLYFSDIRS = &amp;H1&lt;br /&gt;Public Const BIF_STATUSTEXT = &amp;H4&lt;br /&gt;Public Const ERROR_ACCESS_DENIED = 8&lt;br /&gt;Public Const ERROR_ARENA_TRASHED = 7&lt;br /&gt;Public Const ERROR_BADDB = 1&lt;br /&gt;Public Const ERROR_BADKEY = 2&lt;br /&gt;Public Const ERROR_CANTOPEN = 3&lt;br /&gt;Public Const ERROR_CANTREAD = 4&lt;br /&gt;Public Const ERROR_CANTWRITE = 5&lt;br /&gt;Public Const ERROR_NONE = 0&lt;br /&gt;Public Const ERROR_NOT_FOUND As Long = &amp;H80000000&lt;br /&gt;Public Const ERROR_OUTOFMEMORY = 6&lt;br /&gt;Public Const HKEY_CLASSES_ROOT = &amp;H80000000&lt;br /&gt;Public Const HKEY_CURRENT_USER = &amp;H80000001&lt;br /&gt;Public Const HKEY_LOCAL_MACHINE = &amp;H80000002&lt;br /&gt;Public Const HKEY_USERS = &amp;H80000003&lt;br /&gt;Public Const REG_DWORD      As Long = 4&lt;br /&gt;Public Const REG_SZ         As Long = 1&lt;br /&gt;Public Const MAX_PATH As Long = 218&lt;br /&gt;Public Const MAX_TOOLTIP As Long = 64&lt;br /&gt;Public Const SM_CXSCREEN = 0&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/768203630610970059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/768203630610970059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/768203630610970059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/768203630610970059'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/vba-const-values.html' title='VBA Const values'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-4343334985563023764</id><published>2008-06-16T09:26:00.005-04:00</published><updated>2008-06-16T09:41:49.998-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>VBA APIs</title><content type='html'>This is as much for my benefit while traveling as it hopefully will be for yours, but the following is a list of my most-used APIs. I know there are plenty of sites out there that offer the same information, but many times they are not formatted to my liking or they offer it in another language which I have to convert to VBA. This should at least make it a little easier when looking for a specific API.&lt;br /&gt;&lt;br /&gt;This is also going to be post 1 of 3 of this sort of information; I will also (likely very shortly) be posting some of my commonly used CONST values as well as Enum setups.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Public Declare Function CallWindowProc Lib &quot;user32.dll&quot; Alias &quot;CallWindowProcA&quot; (ByVal _&lt;br /&gt;  lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, _&lt;br /&gt;  ByVal lParam As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function CloseClipboard Lib &quot;user32.dll&quot; () As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function EmptyClipboard Lib &quot;user32.dll&quot; () As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function ExtractIcon Lib &quot;shell32.dll&quot; Alias &quot;ExtractIconA&quot; (ByVal _&lt;br /&gt;  hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FindClose Lib &quot;kernel32.dll&quot; (ByVal hFindFile As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FindFirstFile Lib &quot;kernel32.dll&quot; Alias &quot;FindFirstFileA&quot; (ByVal _&lt;br /&gt;  lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FindNextFile Lib &quot;kernel32.dll&quot; Alias &quot;FindNextFileA&quot; (ByVal _&lt;br /&gt;  hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FindWindow Lib &quot;user32.dll&quot; Alias &quot;FindWindowA&quot; (ByVal _&lt;br /&gt;  lpClassName As String, ByVal lpWindowName As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpCreateDirectory Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;FtpCreateDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszDirectory As String _&lt;br /&gt;  ) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpDeleteFile Lib &quot;wininet.dll&quot; Alias &quot;FtpDeleteFileA&quot; (ByVal _&lt;br /&gt;  hFtpSession As Long, ByVal lpszFileName As String) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpFindFirstFile Lib &quot;wininet.dll&quot; Alias &quot;FtpFindFirstFileA&quot; _&lt;br /&gt;  (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, lpFindFileData As _&lt;br /&gt;  WIN32_FIND_DATA, ByVal dwFlags As Long, ByVal dwContent As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpGetCurrentDirectory Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;FtpGetCurrentDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszCurrentDirectory _&lt;br /&gt;  As String, lpdwCurrentDirectory As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpGetFile Lib &quot;wininet.dll&quot; Alias &quot;FtpGetFileA&quot; (ByVal _&lt;br /&gt;  hConnect As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, _&lt;br /&gt;  ByVal fFailIfExists As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags _&lt;br /&gt;  As Long, ByRef dwContext As Long) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpPutFile Lib &quot;wininet.dll&quot; Alias &quot;FtpPutFileA&quot; (ByVal _&lt;br /&gt;  hConnect As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As _&lt;br /&gt;  String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpRemoveDirectory Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;FtpRemoveDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszDirectory As String) _&lt;br /&gt;  As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpRenameFile Lib &quot;wininet.dll&quot; Alias &quot;FtpRenameFileA&quot; (ByVal _&lt;br /&gt;  hFtpSession As Long, ByVal lpszExisting As String, ByVal lpszNew As String) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function FtpSetCurrentDirectory Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;FtpSetCurrentDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszDirectory As _&lt;br /&gt;  String) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function GetClipboardData Lib &quot;user32.dll&quot; (ByVal wFormat As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetDC Lib &quot;user32.dll&quot; (ByVal hwnd As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetDeviceCaps Lib &quot;gdi32.dll&quot; (ByVal hDC As Long, ByVal _&lt;br /&gt;  nIndex As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetFileAttributes Lib &quot;kernel32.dll&quot; Alias _&lt;br /&gt;  &quot;GetFileAttributesA&quot; (ByVal lpFileName As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetOpenFileNameB Lib &quot;comdlg32.dll&quot; Alias _&lt;br /&gt;  &quot;GetOpenFileNameA&quot; (pOpenfilename As OPENFILENAME) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetQueueStatus Lib &quot;user32.dll&quot; (ByVal fuFlags As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetSaveFileNameB Lib &quot;comdlg32.dll&quot; Alias _&lt;br /&gt;  &quot;GetSaveFileNameA&quot; (pOpenfilename As OPENFILENAME) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GetSystemMetrics Lib &quot;user32.dll&quot; (ByVal nIndex As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GlobalAlloc Lib &quot;kernel32.dll&quot; (ByVal wFlags&amp;, ByVal _&lt;br /&gt;  dwBytes As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GlobalLock Lib &quot;kernel32.dll&quot; (ByVal hMem As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GlobalSize Lib &quot;kernel32.dll&quot; (ByVal hMem As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function GlobalUnlock Lib &quot;kernel32.dll&quot; (ByVal hMem As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetCloseHandle Lib &quot;wininet.dll&quot; (ByVal hInet _&lt;br /&gt;  As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetConnect Lib &quot;wininet.dll&quot; Alias &quot;InternetConnectA&quot; _&lt;br /&gt;  (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort _&lt;br /&gt;  As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal lService _&lt;br /&gt;  As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetFindNextFile Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;InternetFindNextFileA&quot; (ByVal hFind As Long, lpvFindData As WIN32_FIND_DATA) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetGetLastResponseInfo Lib &quot;wininet.dll&quot; Alias _&lt;br /&gt;  &quot;InternetGetLastResponseInfoA&quot; (lpdwError As Long, ByVal lpszBuffer As String, _&lt;br /&gt;  lpdwBufferLength As Long) As Boolean&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetOpen Lib &quot;wininet.dll&quot; Alias &quot;InternetOpenA&quot; (ByVal _&lt;br /&gt;  sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal _&lt;br /&gt;  sProxyBypass As String, ByVal lFlags As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetOpenUrl Lib &quot;wininet.dll&quot; Alias &quot;InternetOpenUrlA&quot; _&lt;br /&gt;  (ByVal hOpen As Long, ByVal sUrl As String, ByVal sHeaders As String, ByVal lLength _&lt;br /&gt;  As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function InternetReadFile Lib &quot;wininet.dll&quot; (ByVal hFile As Long, ByVal _&lt;br /&gt;  sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function KillTimer Lib &quot;user32.dll&quot; (ByVal hwnd As Long, ByVal nIDEvent _&lt;br /&gt;  As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function lstrcpy Lib &quot;kernel32.dll&quot; (ByVal lpString1 As Any, ByVal _&lt;br /&gt;  lpString2 As Any) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function lstrlen Lib &quot;kernel32.dll&quot; Alias &quot;lstrlenA&quot; (ByVal lpString _&lt;br /&gt;  As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function OpenClipboard Lib &quot;user32.dll&quot; (ByVal hwnd As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegCloseKey Lib &quot;advapi32.dll&quot; (ByVal hKey As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegCreateKeyEx Lib &quot;advapi32.dll&quot; Alias &quot;RegCreateKeyExA&quot; _&lt;br /&gt;  (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal _&lt;br /&gt;  lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, _&lt;br /&gt;  lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition _&lt;br /&gt;  As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegDeleteValue Lib &quot;advapi32.dll&quot; Alias &quot;RegDeleteValueA&quot; _&lt;br /&gt;  (ByVal hKey As Long, ByVal lpValueName As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegOpenKey Lib &quot;advapi32.dll&quot; Alias &quot;RegOpenKeyA&quot; (ByVal _&lt;br /&gt;  hKey As Long, ByVal lpValueName As String, phkResult As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegOpenKeyEx Lib &quot;advapi32.dll&quot; Alias &quot;RegOpenKeyExA&quot; (ByVal _&lt;br /&gt;  hKey As Long, ByVal lpValueName As String, ByVal ulOptions As Long, ByVal _&lt;br /&gt;  samDesired As Long, phkResult As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegQueryValueEx Lib &quot;advapi32.dll&quot; Alias &quot;RegQueryValueExA&quot; _&lt;br /&gt;  (ByVal hKey As Long, ByVal lpValueName As String, lpReserved As Long, lpType As _&lt;br /&gt;  Long, ByVal lpData As String, lpcbData As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function RegSetValueEx Lib &quot;advapi32.dll&quot; Alias &quot;RegSetValueExA&quot; _&lt;br /&gt;  (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal _&lt;br /&gt;  dwType As Long, lpData As Any, ByVal cbData As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function ReleaseDC Lib &quot;user32.dll&quot; (ByVal hwnd As Long, ByVal hDC _&lt;br /&gt;  As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetClipboardData Lib &quot;user32.dll&quot; (ByVal wFormat As Long, _&lt;br /&gt;  ByVal hMem As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetDefaultPrinter Lib &quot;winspool.drv&quot; Alias &quot;SetDefaultPrinterA&quot; _&lt;br /&gt;  (ByVal pszPrinter As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetForegroundWindow Lib &quot;user32.dll&quot; (ByVal hwnd As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetTimer Lib &quot;user32.dll&quot; (ByVal hwnd As Long, ByVal nIDEvent _&lt;br /&gt;  As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetWindowLong Lib &quot;user32.dll&quot; Alias &quot;SetWindowLongA&quot; (ByVal _&lt;br /&gt;  hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SetWindowPos Lib &quot;user32.dll&quot; (ByVal hwnd As Long, ByVal _&lt;br /&gt;  hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal _&lt;br /&gt;  cy As Long, ByVal wFlags As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SHBrowseForFolder Lib &quot;shell32.dll&quot; Alias &quot;SHBrowseForFolderA&quot; _&lt;br /&gt;  (lpBrowseInfo As BROWSEINFO) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function Shell_NotifyIcon Lib &quot;shell32.dll&quot; Alias &quot;Shell_NotifyIconA&quot; _&lt;br /&gt;  (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function ShellExecute Lib &quot;shell32.dll&quot; Alias &quot;ShellExecuteA&quot; (ByVal _&lt;br /&gt;  hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal _&lt;br /&gt;  lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function SHGetPathFromIDList Lib &quot;shell32.dll&quot; Alias _&lt;br /&gt;  &quot;SHGetPathFromIDListA&quot; (ByVal pidl As Long, ByVal pszPath As String) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function ShowWindow Lib &quot;user32.dll&quot; (ByVal hwnd As Long, ByVal _&lt;br /&gt;  nCmdShow As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function URLDownloadToFile Lib &quot;urlmon.dll&quot; Alias &quot;URLDownloadToFileA&quot; _&lt;br /&gt;  (ByVal pCaller As Long, ByVal szURL As String, ByVal szFilename As String, ByVal _&lt;br /&gt;  dwReserved As Long, ByVal lpfnCB As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Declare Sub CopyMemory Lib &quot;kernel32.dll&quot; Alias &quot;RtlMoveMemory&quot; (ByRef lpDest _&lt;br /&gt;  As Any, ByRef lpSource As Any, ByVal iLen As Long)&lt;br /&gt;&lt;br /&gt;Public Declare Sub keybd_event Lib &quot;user32.dll&quot; (ByVal bVk As Byte, ByVal bScan As _&lt;br /&gt;  Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)&lt;br /&gt;&lt;br /&gt;Public Declare Sub Sleep Lib &quot;kernel32.dll&quot; (ByVal dwMilliseconds As Long)&lt;br /&gt;&lt;br /&gt;Public Declare Function adh_apiGetTime Lib &quot;winmm.dll&quot; Alias &quot;timeGetTime&quot; () As Long&lt;br /&gt;&lt;br /&gt;Public Declare Function IsCharAlphaNumeric Lib &quot;User32&quot; Alias &quot;IsCharAlphaNumericA&quot; _&lt;br /&gt;  (ByVal cChar As Byte) As Long&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/4343334985563023764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/4343334985563023764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/4343334985563023764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/4343334985563023764'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/vba-apis.html' title='VBA APIs'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-8829737551609784397</id><published>2008-06-09T13:00:00.006-04:00</published><updated>2008-06-09T13:40:27.508-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="env2"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="mobile email"/><category scheme="http://www.blogger.com/atom/ns#" term="verizon wireless"/><title type='text'>Accessing GMail IMAP from Verizon&#39;s Mobile Email</title><content type='html'>Before I get into the real topic at hand, I&#39;ll give you the backstory about why I had to get a new phone. To skip to the gmail / mobile email portion, skip ahead 2 paragraphs to the bold &quot;Mobile Email&quot; heading.&lt;br /&gt;&lt;br /&gt;About a year ago, my old phone (motorola E815) started having issues with the charging port, in that it would randomly reset every few seconds while charging so it wouldn&#39;t actually charge anything.  I found a way around it, keeping the plug on a slight angle, etc, and was able to still have it charged every few days (as long as the battery would last me). Sometime this past March even that stopped working, so I went on ebay, bought an extended life battery for my phone, a new back cover for it, and a charger that would charge the battery itself rather than the phone.  This worked out very well, aside from the minor inconvenience of switching batteries which I had to do every week or so (good battery life!).&lt;br /&gt;&lt;br /&gt;Well, last Saturday (May 31), I woke up to an almost dead phone, after putting in a charged battery on Friday morning. I didn&#39;t know why it happened, but maybe it just didn&#39;t charge right or something, I just wrote it off as a fluke. So I charged my extended battery, and a couple hours later I put that in after it was ready.  Sunday morning I woke up to a dead battery again, which I didn&#39;t realize until late afternoon Sunday because I had no reason to look at my phone.  Charged the other battery, put it in, and woke up Monday to a totally dead phone. Did the same song and dance, but now the batteries didn&#39;t seem to last longer than 10-12 hours. Tuesday evening I had enough, so I went into Verizon for them to take a look at it. They said this happens with older batteries, I said I just got this battery in March, they said this could happen with older phones and maybe the circuitry fried or something. I don&#39;t know why it would work for a few hours instead of not-at-all (especially after lasting a week &lt;span style=&quot;font-style:italic;&quot;&gt;last week&lt;/span&gt;, but who knows). The only thing I&#39;ve done at all lately was sign up for the Backup Assistant to run 30 seconds each night, which Verizon swears wouldn&#39;t run longer than that. Maybe they just sent a signal to my phone to stop working so I&#39;d have to get a new phone/contract. So I sucked it up, rewewed my 2 year contract, and after looking at all sorts of options, and researching all my options at home, I went back and I got an LG enV2 (VX9100).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Mobile Email&lt;/span&gt;&lt;br /&gt;My phone had the option of using Verizon&#39;s &quot;Mobile Email&quot; application for email, and since I have a fancy(ish) new phone I might as well use it, see how it works.  As I think I&#39;ve previously said, I use gmail to consolidate all my other email accounts, so I only have to check it via IMAP for a synchronized view of my email from any pc. Really great stuff. &lt;br /&gt;&lt;br /&gt;Well, I opened the app, entered my gmail username/password to sign in, and got a &quot;Invalid account details. Please try again&quot; error. I looked online to make sure the app would work with IMAP, and everything said it would. Tried again, same error. Not sure why I thought it might work the second time, maybe it was out of disbelief.&lt;br /&gt;&lt;br /&gt;I then found a post on &lt;a href=&quot;http://www.howardforums.com/showthread.php?t=1320545&quot; target=&quot;_blank&quot;&gt;howardforums.com&lt;/a&gt; from someone who shared the same error I got.  What they discovered was when logging in, instead of using your @gmail.com address, use @googlemail.com instead and it will prompt you for the settings while logging in.  &lt;span style=&quot;font-weight:bold;&quot;&gt;It worked!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To save you the trouble of looking on that page for instructions and then going to gmail&#39;s imap settings page, here is what you&#39;ll have to change on the setup screen:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Email Address:         &lt;br /&gt;[e.mail@googlemail.com]&lt;br /&gt;&lt;br /&gt;Password:              &lt;br /&gt;********************   &lt;br /&gt;[X]Save password       &lt;br /&gt;&lt;br /&gt;Username:              &lt;br /&gt;[e.mail@gmail.com]     -- Enter gmail address here&lt;br /&gt;[ ]POP3                &lt;br /&gt;[X]IMAP                -- Check this              &lt;br /&gt;&lt;br /&gt;Incoming Mail Server:  &lt;br /&gt;[imap.gmail.com]       -- Enter this server       &lt;br /&gt;Incoming Port:         &lt;br /&gt;[993]                  -- Enter this port         &lt;br /&gt;[ ]None                &lt;br /&gt;[X]SSL                 -- Check this              &lt;br /&gt;[ ]TLS                 &lt;br /&gt;&lt;br /&gt;Outgoing Mail Server:  &lt;br /&gt;[smtp.gmail.com]       -- Enter this server       &lt;br /&gt;Outgoing Port:         &lt;br /&gt;[465]                  -- Enter this port         &lt;br /&gt;[ ]None                &lt;br /&gt;[X]SSL                 -- Check this              &lt;br /&gt;[ ]TLS                 &lt;br /&gt;[X]Requires Login      -- Should already be checked&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;While playing with it the past couple hours, seems WELL worth the $5/mo, if email is important to you. If you&#39;re unsure, try it for a month, you have little to lose :)&lt;br /&gt;&lt;br /&gt;For those curious, this is what my phone looks like. Click the picture for the specs at phonescoop:&lt;br /&gt;&lt;a href=&quot;http://www.phonescoop.com/phones/phone.php?p=1558&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://www.reviewzine.com/images/cellphone/lg-env2.jpg&quot;&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/8829737551609784397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/8829737551609784397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8829737551609784397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8829737551609784397'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/accessing-gmail-imap-from-verizons.html' title='Accessing GMail IMAP from Verizon&#39;s Mobile Email'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-9072700726693685616</id><published>2008-06-05T09:06:00.002-04:00</published><updated>2008-06-05T09:09:16.745-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="addin"/><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>AddIns - Creating menu options</title><content type='html'>Well, I just realized I posted my FoundRange function as part of an earlier post (maybe my Burst function).  That isn&#39;t exactly fair to you now is it.  So here is what I put in my ThisWorkbook object for any add-in I write (non-office2007) to create menus/submenus. The comments in the code should be enough for you, but if you have any questions about it please post a comment!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;&#39;I use this as a basis for the code in ThisWorkbook of most add-ins that I make&lt;br /&gt;&#39; -MenuCaption is the menu in the worksheet menu bar to add to. Feel free to create&lt;br /&gt;&#39;  your own menu, or use an existing menu (using the &amp; symbol for the alt-key shortcut)&lt;br /&gt;&#39;  For example, to add your new option(s) to the &#39;Tools&#39; menu, use &amp;Tools&lt;br /&gt;&#39; -MenuOption1 and MenuOption1MacroName are used for the individual menu options&lt;br /&gt;&#39;  For additional options, follow the same guideline as MenuOption1, and make sure to&lt;br /&gt;&#39;  reference your new Const&#39;ants in the Workbook_Open and RemoveMenuOption subroutines&lt;br /&gt;Private Const MenuCaption As String = &quot;&amp;New Menu&quot;&lt;br /&gt;Private Const MenuOption1 As String = &quot;&amp;Menu Option&quot;&lt;br /&gt;Private Const MenuOption1MacroName As String = &quot;MacroName&quot;&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Open()&lt;br /&gt; Dim CmdBar As Object, NewMenu As Object, NewSubMenu As Object&lt;br /&gt; &lt;br /&gt; RemoveMenuOption&lt;br /&gt; On Error Resume Next&lt;br /&gt; Set CmdBar = Application.CommandBars(&quot;Worksheet Menu Bar&quot;)&lt;br /&gt; Set NewMenu = AddMenu(CmdBar, MenuCaption)&lt;br /&gt;&lt;br /&gt;&#39;&#39;Use syntax like this for a sub-menu&lt;br /&gt;&#39; Set NewSubMenu = AddMenu(NewMenu, MenuName1)&lt;br /&gt;&#39; AddControl NewSubMenu, MenuOption1_1, MenuOption1_1MacroName&lt;br /&gt;&#39; AddControl NewSubMenu, MenuOption1_2, MenuOption1_2MacroName&lt;br /&gt; &lt;br /&gt;&#39;Otherwise use this syntax&lt;br /&gt; AddControl NewMenu, MenuOption1, MenuOption1MacroName&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Function AddMenu(ByRef ParentMenu As Object, ByVal NewMenuName As String) As Object&lt;br /&gt; Dim vNewMenu As Object&lt;br /&gt; On Error Resume Next&lt;br /&gt; Set vNewMenu = ParentMenu.Control(Replace(NewMenuName, &quot;&amp;&quot;, &quot;&quot;))&lt;br /&gt; If vNewMenu Is Nothing Then&lt;br /&gt;  Set vNewMenu = ParentMenu.Controls.Add(Type:=10, Before:=ParentMenu.Controls.Count + 1 _&lt;br /&gt;   , Temporary:=True)   &#39;10=msoControlPopup&lt;br /&gt;  vNewMenu.Caption = NewMenuName&lt;br /&gt; End If&lt;br /&gt; Set AddMenu = vNewMenu&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Private Function AddControl(ByRef NewMenu As Object, ByVal vOption As String, _&lt;br /&gt;  ByVal vOptionMacro As String, Optional ByVal vBeginGroup As Boolean = False) As Boolean&lt;br /&gt; With NewMenu.Controls.Add&lt;br /&gt;  .Caption = vOption&lt;br /&gt;  .BeginGroup = vBeginGroup&lt;br /&gt;  .OnAction = &quot;&#39;&quot; &amp; ThisWorkbook.Name &amp; &quot;&#39;!&quot; &amp; vOptionMacro&lt;br /&gt;  .Tag = Replace(vOption, &quot;&amp;&quot;, &quot;&quot;)&lt;br /&gt; End With&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_AddinUninstall()&lt;br /&gt; RemoveMenuOption&lt;br /&gt; If Not ThisWorkbook.Saved Then ThisWorkbook.Save&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_BeforeClose(Cancel As Boolean)&lt;br /&gt; If Not ThisWorkbook.Saved Then ThisWorkbook.Save&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub RemoveMenuOption()&lt;br /&gt; Dim cBc2 As Object, cBc As Object&lt;br /&gt; On Error Resume Next&lt;br /&gt; For Each cBc In Application.CommandBars(&quot;Worksheet Menu Bar&quot;).Controls&lt;br /&gt;  If Replace(cBc.Caption, &quot;&amp;&quot;, &quot;&quot;) = Replace(MenuCaption, &quot;&amp;&quot;, &quot;&quot;) Then&lt;br /&gt;   For Each cBc2 In cBc.Controls&lt;br /&gt;    Select Case LCase(Replace(cBc2.Caption, &quot;&amp;&quot;, &quot;&quot;))&lt;br /&gt;     Case LCase(Replace(MenuOption1, &quot;&amp;&quot;, &quot;&quot;)):  cBc2.Delete&lt;br /&gt;     &#39;add more additional Case statements here as you add more MenuOptions&lt;br /&gt;    End Select&lt;br /&gt;   Next&lt;br /&gt;   If cBc.Controls.Count = 0 Then cBc.Delete&lt;br /&gt;   Exit For&lt;br /&gt;  End If&lt;br /&gt; Next cBc&lt;br /&gt;End Sub&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/9072700726693685616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/9072700726693685616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/9072700726693685616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/9072700726693685616'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/addins-creating-menu-options.html' title='AddIns - Creating menu options'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-6514953803055493776</id><published>2008-06-05T08:43:00.006-04:00</published><updated>2008-06-05T11:03:59.710-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="job"/><category scheme="http://www.blogger.com/atom/ns#" term="mario kart"/><category scheme="http://www.blogger.com/atom/ns#" term="training"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><category scheme="http://www.blogger.com/atom/ns#" term="wii"/><title type='text'>Miss me?</title><content type='html'>Sorry I&#39;ve been away so long. As you probably know, I&#39;m losing my job at the end of June. My department is being moved to our corporate office in Stamford, CT, and the group taking our work has been a little slow on learning how to do things (we were first told in September about our impending job loss). Now that the time is getting closer and closer, that group is realizing they have a lot more to learn than they thought (i think they thought we did nothing) and on top of me still &lt;span style=&quot;font-style:italic;&quot;&gt;doing&lt;/span&gt; my job I am now showing them how to do it as well.&lt;br /&gt;&lt;br /&gt;Plus, with me leaving in 3 1/2 weeks, some people here in my Rochester office are trying to suck me dry of all sorts of excel and automation info. I enjoy that, but I wish I had more time in the day. But it has been fun, giving people some excel classes, both to groups as a group level (usually basic) as well as a one-on-one level. I have given a few classes here and there for people within my building before, but I am really starting to enjoy it. I wish I could do it full time! Maybe I&#39;ll play the lottery and hope to strike it big, so I can teach people for free for the rest of my life.&lt;br /&gt;&lt;br /&gt;I know some of you think I&#39;m crazy for that. Why not try and get paid for it? Well, for one, I just love to help people. It&#39;s why I love the forums. Beyond that, I live in a smaller market (200,000 people in the city of Rochester, 1-1.5mil in the metro area) and I don&#39;t think there is much interest. Then again, I&#39;m probably wrong, so I&#39;ll have to look into that. Then again, if I move out of the area (looking at the DC area) I&#39;d probably have many more opportunities. Of course an area like that probably has job openings for people like me, not for training but for automation/etc. &lt;br /&gt;&lt;br /&gt;Either way, just wanted to give a reason why I&#39;ve been gone. I did realize one nice thing about teaching people things: you learn stuff yourself. Someone showed me an XP keyboard shortcut (I&#39;m a total keyboard guy), I believe it was alt-up-up or alt-down-down, I don&#39;t remember at the moment as I&#39;m on a win2k machine. It wasn&#39;t anything earth shattering by any means, but always good to learn new stuff :) Another one I found was Alt-Home to go to the home page in a browser. Makes perfect sense, but oddly I never knew it existed; I use it all the time now.&lt;br /&gt;&lt;br /&gt;I&#39;ll try and post some more tonight, I&#39;ve been exhausted in the evenings but I should start trying to do more.&lt;br /&gt;&lt;br /&gt;And for a treat for you, I&#39;m gonna post a subroutine I wrote a while ago that I still love. It is very simple, it just returns a list of all &quot;found&quot; cells in a specified range as a range object. Very useful :)&lt;br /&gt;&lt;pre&gt;Function FoundRange(ByVal vRG As Range, ByVal vVal) As Range&lt;br /&gt; Dim FND As Range, FND1 As Range&lt;br /&gt; Set FND = vRG.Find(vVal, LookIn:=xlValues, LookAt:=xlWhole)&lt;br /&gt; If Not FND Is Nothing Then&lt;br /&gt;  Set FoundRange = FND&lt;br /&gt;  Set FND1 = FND&lt;br /&gt;  Set FND = vRG.FindNext(FND)&lt;br /&gt;  Do Until FND.Address = FND1.Address&lt;br /&gt;   Set FoundRange = Union(FoundRange, FND)&lt;br /&gt;   Set FND = vRG.FindNext(FND)&lt;br /&gt;  Loop&lt;br /&gt; End If&lt;br /&gt;End Function&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Unrelated to VBA, I wanted to give an update for mario kart wii. I got it when it first came out, and played the hell out of it for a week. So much so that my wrists started hurting :( So I have only played it I think twice since then, and both times were less than a half hour. Maybe I&#39;ll buy a gamecube controller to play it during my upcoming mini-retirement (aka: severance) to avoid further damage.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/6514953803055493776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/6514953803055493776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6514953803055493776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6514953803055493776'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/06/miss-me.html' title='Miss me?'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-2171886689025648613</id><published>2008-05-19T10:05:00.005-04:00</published><updated>2008-05-19T10:17:55.421-04:00</updated><title type='text'>Busy days</title><content type='html'>Well, my workdays are going to be very busy the next few days so you&#39;ll likely see very little of me (except when I need a break). In the meantime, however, here are the lyrics to a spoken-word song named Talk To Strangers by Saul Williams. I have this song in my head, so I thought I&#39;d share here. I love the underlying point to it, so don&#39;t let the wall-of-text or the initial lines scare you away. The meaning behind it is worth the length. My apologies to Mr Williams if I have any incorrect lyrics. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now I wasn’t raised at gunpoint and I’ve read too many books&lt;br /&gt;To distract me from the mirror when unhappy with my looks&lt;br /&gt;And I ain’t got proper diction for the makings of a thug&lt;br /&gt;Though I grew up in the ghetto and my n----s all sold drugs&lt;br /&gt;And though that may validate me for a spot on MTV&lt;br /&gt;Or get me all the airplay that my bank account would need&lt;br /&gt;I was hoping to invest in a lesson that I learned&lt;br /&gt;And I thought this fool had jumped me just because it was my turn&lt;br /&gt;I went to an open space &#39;cause I knew he wouldn’t do it&lt;br /&gt;If somebody there could see him or somebody else might prove it&lt;br /&gt;And maybe, in your eyes, it may seem I got punked out&lt;br /&gt;Cause I walked a narrow path and then went and changed my route&lt;br /&gt;But that openness exposed me to a truth I couldn’t find&lt;br /&gt;In the clenched fists of my ego or the confines of my mind&lt;br /&gt;In the hipness of my swagger, or the swagger in my step&lt;br /&gt;Or the scowl of my grimace, or the meanness of my rep&lt;br /&gt;Cause we represent a truth, son, that changes by the hour&lt;br /&gt;And &lt;span style=&quot;font-weight:bold;&quot;&gt;when you&#39;re open to it, formability is power&lt;/span&gt;&lt;br /&gt;And in that shifting form you’ll find a truth that doesn’t change&lt;br /&gt;And that truth is living proof of the fact that God is strange&lt;br /&gt;&lt;br /&gt;Talk to strangers when family fails and friends lead you astray&lt;br /&gt;When Buddha laughs and Jesus weeps and turns out God is gay&lt;br /&gt;Cause angels&#39; and messiahs&#39; love can come in many forms&lt;br /&gt;In the hallways of your projects or the fat girl in your dorm&lt;br /&gt;And when you finally take the time to see what they’re about&lt;br /&gt;Perhaps you find them lonely or their wisdom trips you out&lt;br /&gt;&lt;br /&gt;Maybe you’ll find the cycles end you back where you began&lt;br /&gt;But come this time around you’ll have someone to hold your hand&lt;br /&gt;Who prays for you who&#39;s there for you who sends you love and light&lt;br /&gt;Exposes you to parts of you that you once tried to fight&lt;br /&gt;And come this time around you&#39;ll choose to walk a different path&lt;br /&gt;You&#39;ll embrace what you turned away and cry at what you laughed&lt;br /&gt;Cause that’s the only way we’re going to make it through this storm&lt;br /&gt;Where ignorance is common sense and senselessness is the norm&lt;br /&gt;And flags wave high above the truth and the two never touch&lt;br /&gt;And stolen goods are overpriced and freedom costs too much&lt;br /&gt;And no one seems to recognize the symbols come to life&lt;br /&gt;The bitten apple on the screen and Jesus had a wife&lt;br /&gt;And she was his Messiah like that stranger may be yours&lt;br /&gt;Who holds a subtle knife that carves through worlds like magic doors&lt;br /&gt;And that’s what I’ve been looking for, the bridge from then to now&lt;br /&gt;Just watching BET like, &quot;What the fuck, son? This is foul.&quot;&lt;br /&gt;But that square box don&#39;t represent the sphere that we live in&lt;br /&gt;The earth is not a flat screen, I ain’t trying to fit in&lt;br /&gt;But this ain’t for the underground, this here is for the sun&lt;br /&gt;A seed a stranger gave to me and planted on my tongue&lt;br /&gt;And when I look at you, I know I’m not the only one&lt;br /&gt;As a great man once said,&lt;br /&gt;&quot;There’s nothing more powerful than an idea who’s time has come.&quot;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/2171886689025648613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/2171886689025648613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2171886689025648613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2171886689025648613'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/busy-days.html' title='Busy days'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-727733698290793747</id><published>2008-05-16T14:19:00.004-04:00</published><updated>2008-05-16T14:34:35.759-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="office"/><category scheme="http://www.blogger.com/atom/ns#" term="system tray"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>Minimize userform to system tray</title><content type='html'>During the course of any VBA developer&#39;s life, the desire to want to be able to make a form seem independent of Excel will appear. One nice way to do this is to hide the excel application, so only a userform appears, but it doesnt usually seem the same. One nice thing that can be done to improve the looks (and possible functionality) is to minimize a userform to the system tray. An actual &lt;span style=&quot;font-style:italic;&quot;&gt;need&lt;/span&gt; to do this rarely comes up, but is usually impressive anyways depending on the end user.&lt;br /&gt;&lt;br /&gt;I would like to say for the record that I did not create this code. I found some snippets that others had written in the past, and adapted it for my example. As usual, I researched exactly what it is doing so that I can write something similar from scratch as well as help others with any problems they have doing the same. I really don&#39;t remember who wrote the initial code that I adapted this from though. If you know, please let me know so I can give them proper credit.&lt;br /&gt;&lt;br /&gt;Anyways, this is a pretty simple concept. Create a userform (called UserForm1), and add 2 commandbuttons to it. Keep them at their default name as well. Inside the codepane for the userform, paste the following:&lt;br /&gt;&lt;pre&gt;&#39;******************************************************&#39;&lt;br /&gt;&#39;**************** START USERFORM1 CODE ****************&#39;&lt;br /&gt;&#39;******************************************************&#39;&lt;br /&gt;Option Explicit&lt;br /&gt;Private Sub CommandButton1_Click()&lt;br /&gt; Dim Me_hWnd As Long, Me_Icon As Long, Me_Icon_Handle As Long, IconPath As String&lt;br /&gt; Me_hWnd = FindWindowd(&quot;ThunderDFrame&quot;, UserForm1.Caption)&lt;br /&gt; IconPath = Application.Path &amp; Application.PathSeparator &amp; &quot;excel.exe&quot;&lt;br /&gt; Me_Icon_Handle = ExtractIcond(0, IconPath, 0)&lt;br /&gt; Hook Me_hWnd&lt;br /&gt; AddIconToTray Me_hWnd, 0, Me_Icon_Handle, &quot;Double Click to re-open userform&quot;&lt;br /&gt; Me.Hide&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub CommandButton2_Click()&lt;br /&gt; Application.Visible = True&lt;br /&gt; Unload Me&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub UserForm_Activate()&lt;br /&gt; RemoveIconFromTray&lt;br /&gt; Unhook&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub UserForm_Initialize()&lt;br /&gt; CommandButton1.Caption = &quot;Minimize to tray&quot;&lt;br /&gt; CommandButton2.Caption = &quot;Close this form&quot;&lt;br /&gt; Application.Visible = False&lt;br /&gt;End Sub&lt;br /&gt;&#39;******************************************************&#39;&lt;br /&gt;&#39;***************** END USERFORM1 CODE *****************&#39;&lt;br /&gt;&#39;******************************************************&#39;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then insert a new module in the same project, and paste in the following:&lt;br /&gt;&lt;pre&gt;&#39;******************************************************&#39;&lt;br /&gt;&#39;***************** START MODULE CODE ******************&#39;&lt;br /&gt;&#39;******************************************************&#39;&lt;br /&gt;Option Explicit&lt;br /&gt;Declare Function SetForegroundWindow Lib &quot;User32&quot; (ByVal hwnd As Long) As Long&lt;br /&gt;Declare Function Shell_NotifyIcon Lib &quot;shell32.dll&quot; Alias &quot;Shell_NotifyIconA&quot; ( _&lt;br /&gt;  ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long&lt;br /&gt;Declare Function CallWindowProc Lib &quot;User32&quot; Alias &quot;CallWindowProcA&quot; (ByVal _&lt;br /&gt;  lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam _&lt;br /&gt;  As Long, ByVal lParam As Long) As Long&lt;br /&gt;Declare Function SetWindowLong Lib &quot;User32&quot; Alias &quot;SetWindowLongA&quot; (ByVal hwnd _&lt;br /&gt;  As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long&lt;br /&gt;Declare Function FindWindow Lib &quot;User32&quot; Alias &quot;FindWindowA&quot; (ByVal lpClassName _&lt;br /&gt;  As String, ByVal lpWindowName As String) As Long&lt;br /&gt;Declare Function ExtractIcon Lib &quot;shell32.dll&quot; Alias &quot;ExtractIconA&quot; (ByVal hInst _&lt;br /&gt;  As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long&lt;br /&gt;&lt;br /&gt;Public Const WM_LBUTTONDOWN = &amp;H201&lt;br /&gt;Public Const WM_LBUTTONUP = &amp;H202&lt;br /&gt;Public Const WM_LBUTTONDBL = &amp;H203&lt;br /&gt;Public Const WM_RBUTTONDOWN = &amp;H204&lt;br /&gt;Public Const WM_RBUTTONUP = &amp;H205&lt;br /&gt;Public Const WM_ACTIVATEAPP = &amp;H1C&lt;br /&gt;Public Const NIF_ICON = &amp;H2&lt;br /&gt;Public Const NIF_MESSAGE = &amp;H1&lt;br /&gt;Public Const NIF_TIP = &amp;H4&lt;br /&gt;Public Const NIM_ADD = &amp;H0&lt;br /&gt;Public Const NIM_DELETE = &amp;H2&lt;br /&gt;Public Const MAX_TOOLTIP As Integer = 64&lt;br /&gt;Public Const GWL_WNDPROC = (-4)&lt;br /&gt;&lt;br /&gt;Type NOTIFYICONDATA&lt;br /&gt; cbSize As Long&lt;br /&gt; hwnd As Long&lt;br /&gt; uID As Long&lt;br /&gt; uFlags As Long&lt;br /&gt; uCallbackMessage As Long&lt;br /&gt; hIcon As Long&lt;br /&gt; szTip As String * MAX_TOOLTIP&lt;br /&gt;End Type&lt;br /&gt;&lt;br /&gt;Public nfIconData As NOTIFYICONDATA&lt;br /&gt;&lt;br /&gt;Private FHandle As Long&lt;br /&gt;Private WndProc As Long&lt;br /&gt;Private Hooking As Boolean&lt;br /&gt;&lt;br /&gt;Public Sub Hook(Lwnd As Long)&lt;br /&gt; If Hooking = False Then&lt;br /&gt;  FHandle = Lwnd&lt;br /&gt;  WndProc = SetWindowLong(Lwnd, GWL_WNDPROC, AddressOf WindowProc)&lt;br /&gt;  Hooking = True&lt;br /&gt; End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Sub Unhook()&lt;br /&gt; If Hooking = True Then&lt;br /&gt;  SetWindowLong FHandle, GWL_WNDPROC, WndProc&lt;br /&gt;  Hooking = False&lt;br /&gt; End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Function WindowProc(ByVal hw As Long, ByVal uMsg As Long, ByVal wParam _&lt;br /&gt;  As Long, ByVal lParam As Long) As Long&lt;br /&gt; If Hooking Then&lt;br /&gt;  If lParam = WM_LBUTTONDBL Then&lt;br /&gt;   UserForm1.Show 1&lt;br /&gt;   WindowProc = True&lt;br /&gt;&#39;   Unhook&lt;br /&gt;   Exit Function&lt;br /&gt;  End If&lt;br /&gt;  WindowProc = CallWindowProc(WndProc, hw, uMsg, wParam, lParam)&lt;br /&gt; End If&lt;br /&gt;End Function&lt;br /&gt; &lt;br /&gt;Public Sub RemoveIconFromTray()&lt;br /&gt; Shell_NotifyIcon NIM_DELETE, nfIconData&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Sub AddIconToTray(MeHwnd As Long, MeIcon As Long, MeIconHandle As Long, _&lt;br /&gt;  Tip As String)&lt;br /&gt; With nfIconData&lt;br /&gt;  .hwnd = MeHwnd&lt;br /&gt;  .uID = MeIcon&lt;br /&gt;  .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP&lt;br /&gt;  .uCallbackMessage = WM_RBUTTONUP&lt;br /&gt;  .hIcon = MeIconHandle&lt;br /&gt;  .szTip = Tip &amp; Chr$(0)&lt;br /&gt;  .cbSize = Len(nfIconData)&lt;br /&gt; End With&lt;br /&gt; Shell_NotifyIcon NIM_ADD, nfIconData&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Function FindWindowd(ByVal lpClassName As String, ByVal lpWindowName As String) As Long&lt;br /&gt; FindWindowd = FindWindow(lpClassName, lpWindowName)&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function ExtractIcond(ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal _&lt;br /&gt;  nIconIndex As Long) As Long&lt;br /&gt; ExtractIcond = ExtractIcon(hInst, lpszExeFileName, nIconIndex)&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Sub ShowUserForm()&lt;br /&gt; Application.Visible = False&lt;br /&gt; UserForm1.Show 1&lt;br /&gt;End Sub&lt;br /&gt;&#39;******************************************************&#39;&lt;br /&gt;&#39;****************** END MODULE CODE *******************&#39;&lt;br /&gt;&#39;******************************************************&#39;&lt;/pre&gt;&lt;br /&gt;To try this out, simply run the ShowUserForm subroutine. Pretty cool, huh? Of course this can be quickly ported to run in other office programs as well as vb6, but since I love Excel I see no reason to generalize it for the sake of this post :)</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/727733698290793747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/727733698290793747' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/727733698290793747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/727733698290793747'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/minimize-userform-to-system-tray.html' title='Minimize userform to system tray'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-7290411033228332469</id><published>2008-05-16T12:58:00.003-04:00</published><updated>2008-05-16T13:33:04.309-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="mvp"/><category scheme="http://www.blogger.com/atom/ns#" term="roc"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Heroes Happen Here</title><content type='html'>So yesterday, my fair city got a visit from Microsoft during their &lt;a href=&quot;http://www.microsoft.com/heroeshappenhere/default.mspx&quot;&gt;&quot;HEROES happen {here}&quot;&lt;/a&gt; campaign. They are celebrating/marketing the recent release (and upcoming release, in SQL Server&#39;s case) of 3 new versions of their products: Visual Studio 2008, Windows Server 2008, and MS SQL Server 2008.  Back in February I received an email from my MVP Lead at MS saying that the HHH tour was going around the country, and if we wanted to attend any of them to sign up and let him know so he could notify the peeps running HHH.  After a quick look at the list of cities, I realized Rochester was actually included, so how could I not go?  I expected to be unemployed by this point (fyi, as of now, I&#39;m on through June 30th), but knew that I wanted to go no matter what. So I signed up, and a week later received an email confirming my registration.&lt;br /&gt;&lt;br /&gt;Skip forward 3 months to 3 nights ago, when I realized what the date was and that I had forgotten all about it. I had no expectations of what it was going to entail, but if I could help them out in any way, it would be a good experience. I secured the day off with my supervisor, and woke up early to make it at 7am for the registration (per my confirmation).&lt;br /&gt;&lt;br /&gt;So I get to the convention center, see a couple registration desks and also see an MS employee just inside so I asked her what I should do. I then registered/signed in, and went off to find Gail who was running it to see what was in store for me. I eventually found her (it was still early, and she looked to be getting some fine touches done), so I introduced myself and asked what I could do to help. She walks me over to a table in the &quot;ask an expert&quot; area with a small sign on it saying Microsoft MVP. She said she planned on having me sit there, and answering any questions people may have. I was taken a little back, as I was just an Excel MVP and have only some experience with vs2008, certainly not enough to be an expert with it.  I explained that I would do whatever she thought was best, but that I didn&#39;t really feel that I would be the best person for that job. She said she had wondered about it as well, but seemed happy nonetheless to have a real mvp there. Sure, I could tell my own &quot;hero&quot; story of how I went from lowly office worker to the local excel guru, and eventually an MVP. But in dealing with people who either develop full time, or work in the development field of some sort, why would a VBA programmer be anything special? So I asked her what else I could do.&lt;br /&gt;&lt;br /&gt;At first, I was brought over to relieve one of the other people running the event who was helping out with registration. After a quick explanation of how registration works, I was there for a few hours. Once that became a little less hectic I was moved to a couple other areas there, such as a Speak Your Mind video booth where attendees could record their thoughts for Microsoft to see, as well as a few tasks here and there to make things run smoothly.  I had a great time, got to meet many local people in the field as well as some more people from Microsoft (based out of the Boston area).  I even stepped into a session on using vs2008 with MS Office, but quickly realized the presenter wasn&#39;t showing me anything new.  Most of the people in there seemed genuinely interested in what he was doing and he certainly had a good vibe with the crowd, seemed like a big hit (which did give me a little hope that my skills could be used once my current job is over).&lt;br /&gt;&lt;br /&gt;Overall, I had a good time and I&#39;m happy I attended. I found it interesting (at least it felt so to me) that most of the MS employees had never come across an MVP before and seemed genuinely interested in my story and the whole MVP program. They all seemed to know about it, and had a good impression of it despite not knowing much of it. It had crossed my mind (both before, as well as after, that wonderful &lt;a href=&quot;http://www.mvpsummit2008.com/&quot;&gt;Summit&lt;/a&gt; in April) that only some groups (product teams, PR, marketing) had any interest in the MVP program and that other employees either knew nothing about it or didn&#39;t think that highly of it. I would have to say that after yesterday, I was wrong. None of them seemed to ever deal with an MVP before but all showed immediate respect for me. Perhaps that contributed to my enjoyment of the day, but I think if I had just signed up to attend and didn&#39;t help out at all (which I did for about 8 hours) I would have still thoroughly enjoyed myself.  If you get a chance to attend one of these, by all means do! Good learning experience (so I heard from some attendees of the sessions I did not see), good networking opportunity, and of course good swag (pens, lunch coolers, normal attendees even got free copies of the software being introduced!)&lt;br /&gt;&lt;br /&gt;If you get the chance to see this, or any software roll-out conference, by all means do. You won&#39;t regret it!</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/7290411033228332469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/7290411033228332469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/7290411033228332469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/7290411033228332469'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/heroes-happen-here.html' title='Heroes Happen Here'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-2972017653782455002</id><published>2008-05-16T11:19:00.006-04:00</published><updated>2008-05-16T13:38:29.164-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="Dir"/><category scheme="http://www.blogger.com/atom/ns#" term="FSO"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>Looping through a directory, speed test</title><content type='html'>That last post got me thinking I should share my routine for checking the speeds of the various ways to loop through a folder (vb&#39;s Dir, FileSystemObject, findfile APIs, excel&#39;s application.filesearch). It also would be a good way to put those methods out here for people to use, if you so choose.&lt;br /&gt;I want to warn that you should probably delete your temporary internet files and possibly even your temporary files if you plan on doing this to your root C drive.&lt;br /&gt;&lt;br /&gt;First, the results.&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;On my root C drive&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FSO took 109.047000000002 seconds, 32297 files found&lt;br /&gt;DIR took 73.8910000000013 seconds, 32297 files found&lt;br /&gt;FileSearch took 234.421999999998 seconds, 31727 files found&lt;br /&gt;APIs took 87.999999999998 seconds, 32296 files found&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;On a network drive&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FSO took 3.60899999999802 seconds, 133 files found&lt;br /&gt;DIR took 1.59400000000128 seconds, 133 files found&lt;br /&gt;FileSearch took 0.999999999996682 seconds, 133 files found&lt;br /&gt;APIs took 2.12499999999668 seconds, 133 files found&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Taking a bit of a step back, here is the same test &lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;on a much bigger network drive&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FSO took 801.625000000002 seconds, 8006 files found&lt;br /&gt;DIR took 200.782000000003 seconds, 8006 files found&lt;br /&gt;FileSearch took 77.5940000000007 seconds, 8006 files found&lt;br /&gt;APIs took 282.483999999998 seconds, 8006 files found&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These are pretty consistent with my original findings of it, kinda interesting that filesearch would be so slow on a local drive but much faster on network shares.  Either way, it reaffirms my belief that Dir is the better overall method (filesearch was discontinued, obviously only works in VBA). The slight disparity of file counts (on my local drive) does concern me, though I can only assume (without delving further into it) that a file&#39;s attribute (system, hidden, etc) has something to do with it.&lt;br /&gt;&lt;br /&gt;Take a look at the code I use to test this, if you see any kind of flaw in my logic I&#39;d love to hear about improving it.  Give it a shot on your own computer and see how it works out for you, and post back your results if you&#39;d like!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;Private Declare Function FindFirstFile Lib &quot;kernel32&quot; Alias &quot;FindFirstFileA&quot; ( _&lt;br /&gt;  ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long&lt;br /&gt;Private Declare Function FindNextFile Lib &quot;kernel32&quot; Alias &quot;FindNextFileA&quot; ( _&lt;br /&gt;  ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long&lt;br /&gt;Private Declare Function GetFileAttributes Lib &quot;kernel32&quot; Alias &quot;GetFileAttributesA&quot; ( _&lt;br /&gt;  ByVal lpFileName As String) As Long&lt;br /&gt;Private Declare Function FindClose Lib &quot;kernel32&quot; (ByVal hFindFile As Long) As Long&lt;br /&gt;Private Const MAX_PATH = 260&lt;br /&gt;Private Const MAXDWORD = &amp;HFFFF&lt;br /&gt;Private Const INVALID_HANDLE_VALUE = -1&lt;br /&gt;Private Const FILE_ATTRIBUTE_ARCHIVE = &amp;H20&lt;br /&gt;Private Const FILE_ATTRIBUTE_DIRECTORY = &amp;H10&lt;br /&gt;Private Const FILE_ATTRIBUTE_HIDDEN = &amp;H2&lt;br /&gt;Private Const FILE_ATTRIBUTE_NORMAL = &amp;H80&lt;br /&gt;Private Const FILE_ATTRIBUTE_READONLY = &amp;H1&lt;br /&gt;Private Const FILE_ATTRIBUTE_SYSTEM = &amp;H4&lt;br /&gt;Private Const FILE_ATTRIBUTE_TEMPORARY = &amp;H100&lt;br /&gt;Private Type FILETIME&lt;br /&gt; dwLowDateTime As Long&lt;br /&gt; dwHighDateTime As Long&lt;br /&gt;End Type&lt;br /&gt;Private Type WIN32_FIND_DATA&lt;br /&gt; dwFileAttributes As Long&lt;br /&gt; ftCreationTime As FILETIME&lt;br /&gt; ftLastAccessTime As FILETIME&lt;br /&gt; ftLastWriteTime As FILETIME&lt;br /&gt; nFileSizeHigh As Long&lt;br /&gt; nFileSizeLow As Long&lt;br /&gt; dwReserved0 As Long&lt;br /&gt; dwReserved1 As Long&lt;br /&gt; cFileName As String * MAX_PATH&lt;br /&gt; cAlternate As String * 14&lt;br /&gt;End Type&lt;br /&gt;Private FSO As Object&lt;br /&gt;&lt;br /&gt;Sub SpeedTestCheckCDrive()&lt;br /&gt; Dim DirArray() As String, FSOArray() As String&lt;br /&gt; Dim FSArray() As String, APIArray() As String&lt;br /&gt; Dim i As Long, SearchPath As String&lt;br /&gt; Dim Timer1 As Double, Timer2 As Double, Timer3 As Double, Timer4 As Double&lt;br /&gt; &lt;br /&gt; SearchPath = &quot;C:\&quot;&lt;br /&gt; ReDim FSOArray(0)&lt;br /&gt; ReDim DirArray(1, 0)&lt;br /&gt; ReDim FSArray(0)&lt;br /&gt; ReDim APIArray(0)&lt;br /&gt; &lt;br /&gt; Timer1 = Timer&lt;br /&gt; Set FSO = CreateObject(&quot;scripting.filesystemobject&quot;)&lt;br /&gt; ReturnAllFilesUsingFSO SearchPath, FSOArray&lt;br /&gt; Set FSO = Nothing&lt;br /&gt; Timer1 = Timer - Timer1&lt;br /&gt;DoEvents&lt;br /&gt; Timer2 = Timer&lt;br /&gt; ReturnAllFilesUsingDir SearchPath, DirArray&lt;br /&gt; Timer2 = Timer - Timer2&lt;br /&gt;DoEvents&lt;br /&gt; Timer3 = Timer&lt;br /&gt; ReturnAllFilesUsingFileSearch SearchPath, FSArray&lt;br /&gt; Timer3 = Timer - Timer3&lt;br /&gt;DoEvents&lt;br /&gt; Timer4 = Timer&lt;br /&gt; ReturnAllFilesUsingAPI SearchPath, APIArray&lt;br /&gt; Timer4 = Timer - Timer4&lt;br /&gt; &lt;br /&gt; Debug.Print Join(Array( _&lt;br /&gt;  &quot;FSO took &quot; &amp; Timer1 &amp; &quot; seconds, &quot; &amp; UBound(FSOArray) + 1 &amp; &quot; files found&quot;, _&lt;br /&gt;  &quot;DIR took &quot; &amp; Timer2 &amp; &quot; seconds, &quot; &amp; UBound(DirArray, 2) + 1 &amp; &quot; files found&quot;, _&lt;br /&gt;  &quot;FileSearch took &quot; &amp; Timer3 &amp; &quot; seconds, &quot; &amp; UBound(FSArray) + 1 &amp; &quot; files found&quot;, _&lt;br /&gt;  &quot;APIs took &quot; &amp; Timer4 &amp; &quot; seconds, &quot; &amp; UBound(APIArray) + 1 &amp; &quot; files found&quot;), vbCrLf)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Function ReturnAllFilesUsingDir(ByVal vPath As String, ByRef vsArray() _&lt;br /&gt;  As String, Optional IncludeSubfolders As Boolean = True) As Boolean&lt;br /&gt; &#39;You must send this a string array, ReDim&#39;med to (1,0)&lt;br /&gt; &#39; (0,x) = path of file&lt;br /&gt; &#39; (1,x) = file name&lt;br /&gt; Dim TempStr As String, vDirs() As String, Cnt As Long, dirCnt As Long&lt;br /&gt; dirCnt = 0&lt;br /&gt; If Len(vsArray(0, 0)) = 0 Then&lt;br /&gt;  Cnt = 0&lt;br /&gt; Else&lt;br /&gt;  Cnt = UBound(vsArray, 2) + 1&lt;br /&gt; End If&lt;br /&gt; If Right(vPath, 1) &lt;&gt; &quot;\&quot; Then vPath = vPath &amp; &quot;\&quot;&lt;br /&gt; &lt;br /&gt; If IncludeSubfolders Then&lt;br /&gt;  On Error GoTo BadDir&lt;br /&gt;  TempStr = Dir(vPath, 31)&lt;br /&gt;  Do Until Len(TempStr) = 0&lt;br /&gt;   If Asc(TempStr) &lt;&gt; 46 Then&lt;br /&gt;    If GetAttr(vPath &amp; TempStr) And vbDirectory Then&lt;br /&gt;     ReDim Preserve vDirs(dirCnt)&lt;br /&gt;     vDirs(dirCnt) = TempStr&lt;br /&gt;     dirCnt = dirCnt + 1&lt;br /&gt;     DoEvents&lt;br /&gt;    End If&lt;br /&gt;BadDirGo:&lt;br /&gt;   End If&lt;br /&gt;   TempStr = Dir&lt;br /&gt;SkipDir:&lt;br /&gt;  Loop&lt;br /&gt; End If&lt;br /&gt; &lt;br /&gt; On Error GoTo BadFile&lt;br /&gt; TempStr = Dir(vPath, 15)&lt;br /&gt; Do Until Len(TempStr) = 0&lt;br /&gt;  ReDim Preserve vsArray(1, Cnt)&lt;br /&gt;  vsArray(0, Cnt) = vPath&lt;br /&gt;  vsArray(1, Cnt) = TempStr&lt;br /&gt;  Cnt = Cnt + 1&lt;br /&gt;  TempStr = Dir&lt;br /&gt;  DoEvents&lt;br /&gt; Loop&lt;br /&gt;BadFileGo:&lt;br /&gt; On Error GoTo 0&lt;br /&gt; If dirCnt &gt; 0 Then&lt;br /&gt;  For dirCnt = 0 To UBound(vDirs)&lt;br /&gt;   If Len(Dir(vPath &amp; vDirs(dirCnt))) = 0 Then&lt;br /&gt;    GetFilesWithDir vPath &amp; vDirs(dirCnt), vsArray&lt;br /&gt;   End If&lt;br /&gt;  Next&lt;br /&gt; End If&lt;br /&gt; Exit Function&lt;br /&gt;BadDir:&lt;br /&gt; If TempStr = &quot;pagefile.sys&quot; Or TempStr = &quot;???&quot; Then&lt;br /&gt;  Debug.Print &quot;DIR: Skipping: &quot; &amp; vPath &amp; TempStr&lt;br /&gt;  Resume BadDirGo&lt;br /&gt; ElseIf Err.Number = 52 Then&lt;br /&gt;  Debug.Print &quot;No read dir rights: &quot; &amp; vPath &amp; TempStr&lt;br /&gt;  Resume SkipDir&lt;br /&gt; End If&lt;br /&gt; Debug.Print &quot;Error with DIR Dir: &quot; &amp; Err.Number &amp; &quot; - &quot; &amp; Err.Description&lt;br /&gt; Exit Function&lt;br /&gt;BadFile:&lt;br /&gt; If Err.Number = 52 Then&lt;br /&gt;  Debug.Print &quot;No read file rights: &quot; &amp; vPath &amp; TempStr&lt;br /&gt; Else&lt;br /&gt;  Debug.Print &quot;Error with DIR File: &quot; &amp; Err.Number &amp; &quot; - &quot; &amp; Err.Description&lt;br /&gt; End If&lt;br /&gt; Resume BadFileGo&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function ReturnAllFilesUsingFSO(ByVal vPath As String, _&lt;br /&gt;  ByRef vsArray() As String) As Boolean&lt;br /&gt; Dim f As Object, fld As Object, Cnt As Long&lt;br /&gt; Set fld = FSO.GetFolder(vPath)&lt;br /&gt; If Len(vsArray(0)) = 0 Then&lt;br /&gt;  Cnt = 0&lt;br /&gt; Else&lt;br /&gt;  Cnt = UBound(vsArray) + 1&lt;br /&gt; End If&lt;br /&gt; On Error GoTo UhOhs&lt;br /&gt; For Each f In fld.Files&lt;br /&gt;  ReDim Preserve vsArray(Cnt)&lt;br /&gt;  vsArray(Cnt) = f.Path&lt;br /&gt;  Cnt = Cnt + 1&lt;br /&gt;  DoEvents&lt;br /&gt; Next&lt;br /&gt; For Each f In fld.SubFolders&lt;br /&gt;  ReturnAllFilesUsingFSO f.Path, vsArray&lt;br /&gt; Next&lt;br /&gt;LaterGater:&lt;br /&gt; Set f = Nothing&lt;br /&gt; Set fld = Nothing&lt;br /&gt; Exit Function&lt;br /&gt;UhOhs:&lt;br /&gt; If Err.Number = 70 Then&lt;br /&gt;  Debug.Print &quot;FSO Permission denied: &quot; &amp; vPath&lt;br /&gt; Else&lt;br /&gt;  Debug.Print &quot;Error with FSO: &quot; &amp; Err.Number &amp; &quot; - &quot; &amp; Err.Description&lt;br /&gt; End If&lt;br /&gt; Resume LaterGater&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function ReturnAllFilesUsingFileSearch(ByVal vPath As String, ByRef vsArray() _&lt;br /&gt;  As String) As Long&lt;br /&gt; Dim i As Long, Cnt As Long&lt;br /&gt; With Application.FileSearch&lt;br /&gt;  .NewSearch&lt;br /&gt;  .SearchSubFolders = True&lt;br /&gt;  .LookIn = vPath&lt;br /&gt;  .FileType = msoFileTypeAllFiles&lt;br /&gt;  If .Execute &gt; 0 Then&lt;br /&gt;   Cnt = 0&lt;br /&gt;   On Error GoTo PermissionDenied&lt;br /&gt;   ReDim Preserve vsArray(.FoundFiles.Count - 1)&lt;br /&gt;   For i = 1 To .FoundFiles.Count&lt;br /&gt;    vsArray(Cnt) = .FoundFiles(i)&lt;br /&gt;    Cnt = Cnt + 1&lt;br /&gt;SkipIt:&lt;br /&gt;    DoEvents&lt;br /&gt;   Next&lt;br /&gt;  End If&lt;br /&gt; End With&lt;br /&gt; Exit Function&lt;br /&gt;PermissionDenied:&lt;br /&gt; ReDim Preserve vsArray(UBound(vsArray) - 1)&lt;br /&gt; Resume SkipIt&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function ReturnAllFilesUsingAPI(vPath As String, ByRef vsArray() As String) As Boolean&lt;br /&gt; Dim FileName As String&lt;br /&gt; Dim DirName As String&lt;br /&gt; Dim dirNames() As String&lt;br /&gt; Dim nDir As Long&lt;br /&gt; Dim i As Long&lt;br /&gt; Dim hSearch As Long&lt;br /&gt; Dim WFD As WIN32_FIND_DATA&lt;br /&gt; Dim Cont As Long&lt;br /&gt; Dim Cnt As Long&lt;br /&gt; If Len(vsArray(0)) = 0 Then&lt;br /&gt;  Cnt = 0&lt;br /&gt; Else&lt;br /&gt;  Cnt = UBound(vsArray) + 1&lt;br /&gt; End If&lt;br /&gt; If Right(vPath, 1) &lt;&gt; &quot;\&quot; Then vPath = vPath &amp; &quot;\&quot;&lt;br /&gt; nDir = 0&lt;br /&gt; ReDim dirNames(nDir)&lt;br /&gt; Cont = True&lt;br /&gt; hSearch = FindFirstFile(vPath &amp; &quot;*&quot;, WFD)&lt;br /&gt; If hSearch &lt;&gt; INVALID_HANDLE_VALUE Then&lt;br /&gt;  Do While Cont&lt;br /&gt;   DirName = StripNulls(WFD.cFileName)&lt;br /&gt;   If (DirName &lt;&gt; &quot;.&quot;) And (DirName &lt;&gt; &quot;..&quot;) Then&lt;br /&gt;    If GetFileAttributes(vPath &amp; DirName) And FILE_ATTRIBUTE_DIRECTORY Then&lt;br /&gt;     ReDim Preserve dirNames(nDir)&lt;br /&gt;     dirNames(nDir) = DirName&lt;br /&gt;     nDir = nDir + 1&lt;br /&gt;     DoEvents&lt;br /&gt;    End If&lt;br /&gt;   End If&lt;br /&gt;   Cont = FindNextFile(hSearch, WFD)&lt;br /&gt;  Loop&lt;br /&gt;  Cont = FindClose(hSearch)&lt;br /&gt; End If&lt;br /&gt; hSearch = FindFirstFile(vPath &amp; &quot;*&quot;, WFD)&lt;br /&gt; Cont = True&lt;br /&gt; If hSearch &lt;&gt; INVALID_HANDLE_VALUE Then&lt;br /&gt;  While Cont&lt;br /&gt;   FileName = StripNulls(WFD.cFileName)&lt;br /&gt;    If (FileName &lt;&gt; &quot;.&quot;) And (FileName &lt;&gt; &quot;..&quot;) And ((GetFileAttributes(vPath _&lt;br /&gt;      &amp; FileName) And FILE_ATTRIBUTE_DIRECTORY) &lt;&gt; FILE_ATTRIBUTE_DIRECTORY) Then&lt;br /&gt;     ReDim Preserve vsArray(Cnt)&lt;br /&gt;     vsArray(Cnt) = vPath &amp; FileName&lt;br /&gt;     Cnt = Cnt + 1&lt;br /&gt;    End If&lt;br /&gt;   Cont = FindNextFile(hSearch, WFD)&lt;br /&gt;  Wend&lt;br /&gt;  Cont = FindClose(hSearch)&lt;br /&gt; End If&lt;br /&gt; If nDir &gt; 0 Then&lt;br /&gt;  For i = 0 To nDir - 1&lt;br /&gt;   ReturnAllFilesUsingAPI vPath &amp; dirNames(i) &amp; &quot;\&quot;, vsArray&lt;br /&gt;  Next i&lt;br /&gt; End If&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Private Function StripNulls(OriginalStr As String) As String&lt;br /&gt; If (InStr(OriginalStr, Chr(0)) &gt; 0) Then&lt;br /&gt;  OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1)&lt;br /&gt; End If&lt;br /&gt; StripNulls = OriginalStr&lt;br /&gt;End Function&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/2972017653782455002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/2972017653782455002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2972017653782455002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2972017653782455002'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/looping-through-directory-speed-test.html' title='Looping through a directory, speed test'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-8987437206350485060</id><published>2008-05-16T11:01:00.004-04:00</published><updated>2008-05-16T11:11:16.474-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dir"/><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="Folder"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>Loop through all files within a directory</title><content type='html'>Another thing I see a lot is where someone wants to loop through a directory (and/or subfolders). There are a number of ways to do this, such as VB&#39;s Dir() method, FileSystemObject, FindFirstFile/FindNextFile APIs, even Application.FileSearch (up through excel 2003, I believe). I have done a few speed tests for various threads, and usually find Dir() to be the quickest (usually true for local disks; network shares seem to vary).  Dir is also the one I go with the most, as it doesn&#39;t require and early/late binding for FSO, and needs no API declare statements. &lt;br /&gt;&lt;br /&gt;Note that if you&#39;re working in VBScript, you will have to use FileSystemObject, as Dir() doesn&#39;t exist in VBS and APIs are more trouble than they&#39;re worth if you want to use them (you&#39;d have to create a container class in vb to use them in vbs).&lt;br /&gt;&lt;br /&gt;Here is an example of looping through all the files within a specific directory; my calling subroutine just sends a message box with the number of files contained, but it can obviously do much more.  I&#39;m also including a simple routine called DesktopAddress, should anyone ever want to know the desktop&#39;s location via code (I use this is many of my distributed projects at work, actually).  Run the LoopThroughAllFilesInDirectory to return a filecount of files on your desktop, and change as needed!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Sub LoopThroughAllFilesInDirectory()&lt;br /&gt; Dim vFiles() As String, i As Long&lt;br /&gt; ReDim vFiles(1, 0)&lt;br /&gt; GetFilesWithDir DesktopAddress, vFiles &#39;all files desktop + below&lt;br /&gt; MsgBox &quot;You have &quot; &amp; CStr(UBound(vFiles, 2) + 1) &amp; &quot; files on your desktop&quot;&lt;br /&gt;End Sub&lt;br /&gt;Function DesktopAddress() As String&lt;br /&gt; Dim vShell As Object, vDesktop As String&lt;br /&gt; Set vShell = CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt; vDesktop = vShell.SpecialFolders(&quot;Desktop&quot;)&lt;br /&gt; If Right(vDesktop, 1) &lt;&gt; &quot;\&quot; Then vDesktop = vDesktop &amp; &quot;\&quot;&lt;br /&gt; DesktopAddress = vDesktop&lt;br /&gt; Set vShell = Nothing&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function GetFilesWithDir(ByVal vPath As String, ByRef vsArray() _&lt;br /&gt;  As String, Optional IncludeSubfolders As Boolean = True) As Boolean&lt;br /&gt; &#39;You must send this a string array, ReDim&#39;med to (1,0)&lt;br /&gt; &#39; (0,x) = path of file&lt;br /&gt; &#39; (1,x) = file name&lt;br /&gt; Dim TempStr As String, vDirs() As String, Cnt As Long, dirCnt As Long&lt;br /&gt; dirCnt = 0&lt;br /&gt; If Len(vsArray(0, 0)) = 0 Then&lt;br /&gt;  Cnt = 0&lt;br /&gt; Else&lt;br /&gt;  Cnt = UBound(vsArray, 2) + 1&lt;br /&gt; End If&lt;br /&gt; If Right(vPath, 1) &lt;&gt; &quot;\&quot; Then vPath = vPath &amp; &quot;\&quot;&lt;br /&gt; &lt;br /&gt; If IncludeSubfolders Then&lt;br /&gt;  On Error GoTo BadDir&lt;br /&gt;  TempStr = Dir(vPath, 31)&lt;br /&gt;  Do Until Len(TempStr) = 0&lt;br /&gt;   If Asc(TempStr) &lt;&gt; 46 Then&lt;br /&gt;    If GetAttr(vPath &amp; TempStr) And vbDirectory Then&lt;br /&gt;     ReDim Preserve vDirs(dirCnt)&lt;br /&gt;     vDirs(dirCnt) = TempStr&lt;br /&gt;     dirCnt = dirCnt + 1&lt;br /&gt;    End If&lt;br /&gt;BadDirGo:&lt;br /&gt;   End If&lt;br /&gt;   TempStr = Dir&lt;br /&gt;SkipDir:&lt;br /&gt;  Loop&lt;br /&gt; End If&lt;br /&gt; &lt;br /&gt; On Error GoTo BadFile&lt;br /&gt; TempStr = Dir(vPath, 15)&lt;br /&gt; Do Until Len(TempStr) = 0&lt;br /&gt;  ReDim Preserve vsArray(1, Cnt)&lt;br /&gt;  vsArray(0, Cnt) = vPath&lt;br /&gt;  vsArray(1, Cnt) = TempStr&lt;br /&gt;  Cnt = Cnt + 1&lt;br /&gt;  TempStr = Dir&lt;br /&gt; Loop&lt;br /&gt;BadFileGo:&lt;br /&gt; On Error GoTo 0&lt;br /&gt; If dirCnt &gt; 0 Then&lt;br /&gt;  For dirCnt = 0 To UBound(vDirs)&lt;br /&gt;   If Len(Dir(vPath &amp; vDirs(dirCnt))) = 0 Then&lt;br /&gt;    GetFilesWithDir vPath &amp; vDirs(dirCnt), vsArray&lt;br /&gt;   End If&lt;br /&gt;  Next&lt;br /&gt; End If&lt;br /&gt; Exit Function&lt;br /&gt;BadDir:&lt;br /&gt; If TempStr = &quot;pagefile.sys&quot; Or TempStr = &quot;???&quot; Then&lt;br /&gt;  Debug.Print &quot;DIR: Skipping: &quot; &amp; vPath &amp; TempStr&lt;br /&gt;  Resume BadDirGo&lt;br /&gt; ElseIf Err.Number = 52 Then&lt;br /&gt;  Debug.Print &quot;No read dir rights: &quot; &amp; vPath &amp; TempStr&lt;br /&gt;  Resume SkipDir&lt;br /&gt; End If&lt;br /&gt; Debug.Print &quot;Error with DIR Dir: &quot; &amp; Err.Number &amp; &quot; - &quot; &amp; Err.Description&lt;br /&gt; Exit Function&lt;br /&gt;BadFile:&lt;br /&gt; If Err.Number = 52 Then&lt;br /&gt;  Debug.Print &quot;No read file rights: &quot; &amp; vPath &amp; TempStr&lt;br /&gt; Else&lt;br /&gt;  Debug.Print &quot;Error with DIR File: &quot; &amp; Err.Number &amp; &quot; - &quot; &amp; Err.Description&lt;br /&gt; End If&lt;br /&gt; Resume BadFileGo&lt;br /&gt;End Function&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/8987437206350485060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/8987437206350485060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8987437206350485060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8987437206350485060'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/loop-through-all-files-within-directory.html' title='Loop through all files within a directory'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-2630640721601985008</id><published>2008-05-16T10:05:00.006-04:00</published><updated>2008-05-16T10:25:18.777-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RegExp"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><category scheme="http://www.blogger.com/atom/ns#" term="VBS"/><title type='text'>VBA/VB6/VBS word replace - Regular expressions</title><content type='html'>Did you ever wish you could replace entire words within a string? Maybe you&#39;re changing names within a document and want to change &quot;Mark&quot; to &quot;Horace&quot;, but don&#39;t want to have &quot;market&quot; turn into &quot;Horaceet&quot;.  Or maybe you want to insert a word, but only in relation to another specific word? Then use regular expressions!&lt;br /&gt;&lt;br /&gt;Make sure to escape any regexp special characters, and use the \b word boundaries around the &#39;Find what&#39; portion.  Occasionally I&#39;ll even use my &quot;rxPatt = ...&quot; line in other routines when I need to escape a search string for regexp.  Works well, though I find myself using this less and less nowadays. Unless you have long strings within cells, it isn&#39;t that useful for Excel unfortunately.  I have found a couple uses here and there, but not too many.&lt;br /&gt;&lt;br /&gt;Anyways.. on to the code!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Function RegExWordReplace(ByVal rxFull As String, ByVal rxWhat As String, ByVal _&lt;br /&gt;  rxRepl As String, Optional ByVal rxIgnoreCase As Boolean = True) As String&lt;br /&gt; &#39;rxFull = Full string that you will be doing your find/replace within&lt;br /&gt; &#39;rxWhat = What to find within the full string&lt;br /&gt; &#39;rxRepl = What to replace the found string with&lt;br /&gt; &#39;rxIgnoreCase = You can make the search case-sensitive by specifying this = false&lt;br /&gt; Dim RegEx As Object, rxPatt As String&lt;br /&gt; Set RegEx = CreateObject(&quot;vbscript.regexp&quot;)&lt;br /&gt; rxPatt = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace( _&lt;br /&gt;  Replace(Replace(Replace(Replace(rxWhat, &quot;\&quot;, &quot;\\&quot;), &quot;^&quot;, &quot;\^&quot;), &quot;$&quot;, &quot;\$&quot;), &quot;*&quot;, _&lt;br /&gt;  &quot;\*&quot;), &quot;+&quot;, &quot;\+&quot;), &quot;?&quot;, &quot;\?&quot;), &quot;.&quot;, &quot;\.&quot;), &quot;(&quot;, &quot;\(&quot;), &quot;)&quot;, &quot;\)&quot;), &quot;|&quot;, &quot;\|&quot;), _&lt;br /&gt;  &quot;{&quot;, &quot;\{&quot;), &quot;}&quot;, &quot;\}&quot;), &quot;,&quot;, &quot;\,&quot;)&lt;br /&gt; With RegEx&lt;br /&gt;  .Pattern = &quot;\b&quot; &amp; rxPatt &amp; &quot;\b&quot;&lt;br /&gt;  .Global = True&lt;br /&gt;  .IgnoreCase = rxIgnoreCase&lt;br /&gt;  .MultiLine = True&lt;br /&gt; End With&lt;br /&gt; If RegEx.Test(rxFull) Then rxFull = RegEx.Replace(rxFull, rxRepl)&lt;br /&gt; RegExWordReplace = rxFull&lt;br /&gt; Set RegEx = Nothing&lt;br /&gt;End Function&lt;/pre&gt;&lt;br /&gt;And to test it:&lt;br /&gt;&lt;pre&gt;Sub WordReplaceExample()&lt;br /&gt; Dim OrigStr As String, NewStr As String&lt;br /&gt; OrigStr = &quot;Our normal products were found to have no side effects.&quot;&lt;br /&gt; NewStr = RegExWordReplace(OrigStr, &quot;no&quot;, &quot;no adverse&quot;)&lt;br /&gt; MsgBox OrigStr &amp; vbCrLf &amp; vbCrLf &amp; NewStr&lt;br /&gt;End Sub&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/2630640721601985008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/2630640721601985008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2630640721601985008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2630640721601985008'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/vbavb6vbs-word-replace-regular.html' title='VBA/VB6/VBS word replace - Regular expressions'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-445751908522591398</id><published>2008-05-14T12:50:00.005-04:00</published><updated>2008-05-14T13:12:05.702-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="office"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>Splitting a worksheet based on a column&#39;s value</title><content type='html'>One question I come across a lot is when someone has a lot of data on a single worksheet, and wants to split it out to multiple worksheets based on the value of a column. For example, if someone had the following birthday data on a worksheet, and wanted to have a sheet for each month. Assume this sample data:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SHEET NAME: Birthdays&lt;br /&gt;Name    Month      Day&lt;br /&gt;Emmy    August     27&lt;br /&gt;Bill    July       3&lt;br /&gt;Andy    November   24&lt;br /&gt;Bob     July       27&lt;br /&gt;Dana    June       24&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And after running a macro:&lt;br /&gt;&lt;pre&gt;SHEET NAME: August&lt;br /&gt;Name    Month      Day&lt;br /&gt;Emmy    August     27&lt;br /&gt;&lt;br /&gt;SHEET NAME: July&lt;br /&gt;Name    Month      Day&lt;br /&gt;Bill    July       3&lt;br /&gt;Bob     July       27&lt;br /&gt;&lt;br /&gt;SHEET NAME: November&lt;br /&gt;Name    Month      Day&lt;br /&gt;Andy    November   24&lt;br /&gt;&lt;br /&gt;SHEET NAME: June&lt;br /&gt;Name    Month      Day&lt;br /&gt;Dana    June       24&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That is a simplistic example, but I see something like that frequently. The following code will do that for you, just set the column to use for the splitting-data and run.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;Sub SplitIntoMultipleSheetsBasedOnColumn()&lt;br /&gt; Dim TheColumn As Range, ValRG As Range&lt;br /&gt; Dim UniqVals() As Variant, AllVals() As Variant&lt;br /&gt; Dim FirstDataRow As Long, i As Long, Cnt As Long&lt;br /&gt; &lt;br /&gt; &#39;Unique values in the column specified by TheColumn are given their own worksheet,&lt;br /&gt; &#39; and their entire row is copied to that worksheet&lt;br /&gt; Set TheColumn = Columns(&quot;G&quot;) &#39;must be a single column&lt;br /&gt; FirstDataRow = 2 &#39;so that the header row(s) aren&#39;t turned into a sheet&lt;br /&gt; &lt;br /&gt; Set ValRG = Intersect(TheColumn, TheColumn.Worksheet.UsedRange, _&lt;br /&gt;  TheColumn.Worksheet.Rows(FirstDataRow &amp; &quot;:&quot; &amp; TheColumn.Worksheet.Rows.Count))&lt;br /&gt; If ValRG Is Nothing Then&lt;br /&gt;  MsgBox &quot;No data found. Exiting.&quot;&lt;br /&gt;  Exit Sub&lt;br /&gt; End If&lt;br /&gt; ReDim UniqVals(0)&lt;br /&gt; Cnt = 0&lt;br /&gt; AllVals = ValRG.Value&lt;br /&gt; For i = 1 To UBound(AllVals, 1)&lt;br /&gt;  If Not InArray(UniqVals, AllVals(i, 1)) Then&lt;br /&gt;   ReDim Preserve UniqVals(Cnt)&lt;br /&gt;   UniqVals(Cnt) = AllVals(i, 1)&lt;br /&gt;   Cnt = Cnt + 1&lt;br /&gt;  End If&lt;br /&gt; Next &#39;i&lt;br /&gt; &lt;br /&gt; Application.ScreenUpdating = False&lt;br /&gt; For i = LBound(UniqVals) To UBound(UniqVals)&lt;br /&gt;  Set ValRG = FoundRange(TheColumn, UniqVals(i))&lt;br /&gt;  With Sheets.Add(After:=Sheets(Sheets.Count))&lt;br /&gt;   On Error Resume Next&lt;br /&gt;   .Name = ValidSheetName(UniqVals(i))&lt;br /&gt;   On Error GoTo 0&lt;br /&gt;   If FirstDataRow &gt; 1 Then TheColumn.Worksheet.Range(TheColumn.Cells(1), _&lt;br /&gt;    TheColumn.Cells(FirstDataRow - 1)).EntireRow.Copy .Range(&quot;A1&quot;)&lt;br /&gt;   ValRG.EntireRow.Copy .Range(&quot;A&quot; &amp; FirstDataRow)&lt;br /&gt;  End With&lt;br /&gt; Next &#39;i&lt;br /&gt; Application.ScreenUpdating = True&lt;br /&gt;End Sub&lt;br /&gt;Private Function ValidSheetName(ByVal DesiredSheetName As String) As String&lt;br /&gt; On Error Resume Next&lt;br /&gt; ValidSheetName = Left(Replace(Replace(Replace(Replace(Replace(Replace(Replace( _&lt;br /&gt;  DesiredSheetName, &quot;:&quot;, &quot;&quot;), &quot;\&quot;, &quot;&quot;), &quot;/&quot;, &quot;&quot;), &quot;?&quot;, &quot;&quot;), &quot;*&quot;, &quot;&quot;), &quot;[&quot;, &quot;&quot;), _&lt;br /&gt;  &quot;]&quot;, &quot;&quot;), 31)&lt;br /&gt;End Function&lt;br /&gt;Public Function InArray(ByRef vArray(), ByVal vValue) As Boolean&lt;br /&gt; Dim i As Long&lt;br /&gt; For i = LBound(vArray) To UBound(vArray)&lt;br /&gt;  If vArray(i) = vValue Then&lt;br /&gt;   InArray = True&lt;br /&gt;   Exit Function&lt;br /&gt;  End If&lt;br /&gt; Next &#39;i&lt;br /&gt; InArray = False&lt;br /&gt;End Function&lt;br /&gt;Function FoundRange(ByVal vRG As Range, ByVal vVal) As Range&lt;br /&gt; Dim FND As Range, FND1 As Range&lt;br /&gt; Set FND = vRG.Find(vVal, LookIn:=xlValues, LookAt:=xlWhole)&lt;br /&gt; If Not FND Is Nothing Then&lt;br /&gt;  Set FoundRange = FND&lt;br /&gt;  Set FND1 = FND&lt;br /&gt;  Set FND = vRG.FindNext(FND)&lt;br /&gt;  Do Until FND.Address = FND1.Address&lt;br /&gt;   Set FoundRange = Union(FoundRange, FND)&lt;br /&gt;   Set FND = vRG.FindNext(FND)&lt;br /&gt;  Loop&lt;br /&gt; End If&lt;br /&gt;End Function&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that you don&#39;t need to sort your sheet first, though it will make things run a bit smoother. I originally had the code go through an array containing the sheet data, but a lot of the format was being lost. This way takes slightly longer but everything stays to the new sheets.  I use this for my job, and I&#39;m sure other people can use it for theirs as well.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/445751908522591398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/445751908522591398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/445751908522591398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/445751908522591398'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/splitting-worksheet-based-on-columns.html' title='Splitting a worksheet based on a column&#39;s value'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-3154595725561543015</id><published>2008-05-14T11:08:00.009-04:00</published><updated>2008-05-14T13:04:06.733-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Recycling Bin"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>Working with the recycling bin</title><content type='html'>Now, if you&#39;ve ever tried to interact with the recycling bin in VBA (or VB6) you probably know it can get a bit complicated at times. pIDLs, IShellFolder interfaces, lots of fun stuff.  Did you know you can do some basic tasks &lt;span style=&quot;font-style: italic;&quot;&gt;without&lt;/span&gt; using any of that? Some examples:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Send a file to the recycling bin rather than just deleting it&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;Private Type SHFILEOPTSTRUCT&lt;br /&gt; hWnd As Long&lt;br /&gt; wFunc As Long&lt;br /&gt; pFrom As String&lt;br /&gt; pTo As String&lt;br /&gt; fFlags As Integer&lt;br /&gt; fAnyOperationsAborted As Long&lt;br /&gt; hNameMappings As Long&lt;br /&gt; lpszProgressTitle As Long&lt;br /&gt;End Type&lt;br /&gt;Private Declare Function SHFileOperation Lib &quot;shell32.dll&quot; Alias &quot;SHFileOperationA&quot; ( _&lt;br /&gt;  lpFileOp As SHFILEOPTSTRUCT) As Long&lt;br /&gt;Private Const FO_DELETE = &amp;H3&lt;br /&gt;Private Const FOF_ALLOWUNDO = &amp;H40&lt;br /&gt;Public Sub DeleteFileToRecycleBin(vFilename As String)&lt;br /&gt; Dim vFileOp As SHFILEOPTSTRUCT&lt;br /&gt; With vFileOp&lt;br /&gt;  .wFunc = FO_DELETE&lt;br /&gt;  .pFrom = vFilename&lt;br /&gt;  .fFlags = FOF_ALLOWUNDO&lt;br /&gt; End With&lt;br /&gt; SHFileOperation vFileOp&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Empty the recycling bin&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;Private Declare Function SHEmptyRecycleBin Lib &quot;shell32.dll&quot; Alias &quot;SHEmptyRecycleBinA&quot; _&lt;br /&gt; (ByVal hWnd As Integer, ByVal pszRootPath As String, ByVal dwFlags As Integer) As Integer&lt;br /&gt;Private Declare Function SHUpdateRecycleBinIcon Lib &quot;shell32.dll&quot; () As Long&lt;br /&gt;Private Const SHERB_NOCONFIRMATION = &amp;H1&lt;br /&gt;Private Const SHERB_NOPROGRESSUI = &amp;H2&lt;br /&gt;Private Const SHERB_NOSOUND = &amp;H4&lt;br /&gt;Private Sub EmptyRecycleBin()&lt;br /&gt; SHEmptyRecycleBin 0, vbNullString, SHERB_NOCONFIRMATION&lt;br /&gt; SHUpdateRecycleBinIcon&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Restore from the recycling bin&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;Sub RestoreFromRecyclingBin()&lt;br /&gt; Dim vShell As Object, vRecycler As Object&lt;br /&gt; Const ssfBITBUCKET As Long = 10 &#39;the BitBucket is the recycling bin&lt;br /&gt; Set vShell = CreateObject(&quot;Shell.Application&quot;)&lt;br /&gt; Set vRecycler = vShell.NameSpace(ssfBITBUCKET)&lt;br /&gt; RestoreRecycledItems vRecycler&lt;br /&gt; Set vRecycler = Nothing&lt;br /&gt; Set vShell = Nothing&lt;br /&gt;End Sub&lt;br /&gt;Private Sub RestoreRecycledItems(vObj As Object)&lt;br /&gt; Dim vItem As Object&lt;br /&gt; For Each vItem In vObj.Items&lt;br /&gt;  &#39;Remove this next line if you don&#39;t want to iterate through a deleted folder&lt;br /&gt;  If vItem.IsFolder Then Call RestoreRecycledItems(vItem)&lt;br /&gt;   &lt;br /&gt;  &#39;You can use   vObj.GetDetailsOf(vItem, x)   where x is a number from 0 to 4, to return&lt;br /&gt;  &#39;   string information about the recycled item. Definition of x:&lt;br /&gt;  &#39; 0 = Filename&lt;br /&gt;  &#39; 1 = Path&lt;br /&gt;  &#39; 2 = Deleted Date/Time&lt;br /&gt;  &#39; 3 = File type (long name, not extension)&lt;br /&gt;  &#39; 4 = Size (in KB, or whatever your windows explorer uses as default size)&lt;br /&gt;  &lt;br /&gt;  &#39;Here I will check the deleted date, and if it was deleted today, restore it&lt;br /&gt;  &#39; Since   .GetDetailsOf(vItem ,2)   returns deleted date and time, I cut off the time&lt;br /&gt;  If Int(CDate(vObj.GetDetailsOf(vItem, 2))) = Date Then&lt;br /&gt;   &#39;use the folderitem&#39;s InvokeVerb method to restore it&lt;br /&gt;   Call vItem.InvokeVerb(&quot;R&amp;estore&quot;)&lt;br /&gt;  End If&lt;br /&gt; Next&lt;br /&gt; Set vItem = Nothing&lt;br /&gt; Set vObj = Nothing&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fun, huh?</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/3154595725561543015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/3154595725561543015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/3154595725561543015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/3154595725561543015'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/working-with-recycling-bin.html' title='Working with the recycling bin'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-575626994550549301</id><published>2008-05-13T13:03:00.002-04:00</published><updated>2008-05-13T13:44:14.542-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><category scheme="http://www.blogger.com/atom/ns#" term="woot"/><title type='text'>Wootoffs</title><content type='html'>Do you ever &lt;a href=&quot;http://www.woot.com/&quot;&gt;Woot&lt;/a&gt;? I do. If you do too, then you probably know what a Wootoff is. Ever wish you could easily know what item is up and how much is left (and be more ready when their bags of crap are available, since you have literally only seconds to buy one). Well why not use our favorite tool (Excel)! I made this for a wootoff last week Heres how you can do it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;a href=&quot;http://mvexcel.googlepages.com/wootie.xla&quot;&gt;wootie.xla&lt;/a&gt;, and save it to your addins directory, usually:&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;C:\Documents and Settings\&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;your-username&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;\Application Data\Microsoft\AddIns&lt;/span&gt;\&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Open Excel, and with a workbook open go to &lt;span style=&quot;font-weight: bold;&quot;&gt;Tools&lt;/span&gt; then &lt;span style=&quot;font-weight: bold;&quot;&gt;AddIns&lt;/span&gt;.  If you do not see Wootie listed, then click Browse and select wootie.xla&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;After your &quot;Help&quot; menu there will now be a Wootie menu. Assuming there is a wootoff, go to Start Wootoff, and you should be all set!&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;As with all my add-ins, I kept it unlocked and the source code is fully viewable/editable.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;It helped me out this past wootoff, hopefully it&#39;ll help you out as well. Beware though, if you plan on actually &lt;span style=&quot;font-style: italic;&quot;&gt;using&lt;/span&gt; Excel during this time, you may want to open a new instance of Excel for Wootie so it doesn&#39;t interfere. I coded it to hide the excel application while the IE statusbar window is up, but don&#39;t worry if you forgot and think your open files are gone; they&#39;ll be back when the IE window closes. I went with IE instead of a userform so that I could easily open a new window when a bag of crap comes up (less load time if it is already open). And for the more advanced users, you can always code yourself a BOC-sniping subroutine for when they&#39;re available (the other benefit of IE--easy automation from vba)</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/575626994550549301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/575626994550549301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/575626994550549301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/575626994550549301'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/wootoffs.html' title='Wootoffs'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-2251171695649683099</id><published>2008-05-13T12:29:00.003-04:00</published><updated>2008-05-13T12:38:06.570-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apple"/><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="office"/><category scheme="http://www.blogger.com/atom/ns#" term="VBA"/><title type='text'>VBA will be back for Mac Office!</title><content type='html'>Ok, those of you that know me know that I&#39;m not a huge Mac/Apple fan. I&#39;m not really much against them, though I don&#39;t like the &#39;anti-pc&#39; tone of their commercials versus a traditional &#39;pro-mac&#39; commercial.  Regardless, being a huge Excel and VBA fan, I felt bad for the many mac users that bought Office 2008 only to find out VBA was gone. Now I know the reasons behind it, so I&#39;m not going to whinge about it, but it still sucked. That move alone would have prompted me to leave my mac in the dust (if I had one), despite it being a decision on Microsoft&#39;s part rather than Apple&#39;s.&lt;br /&gt;&lt;br /&gt;So I was &lt;a href=&quot;http://www.microsoft.com/presspass/press/2008/may08/05-13MacBU2008PR.mspx&quot;&gt;very happy to read today&lt;/a&gt; that VBA will be back in the next version of Mac Office! The press release is really about the release of SP1, but said MS will be bringing VBA back at a yet-unspecified future date. Score one for the good guys!&lt;br /&gt;&lt;br /&gt;Go VBA!</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/2251171695649683099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/2251171695649683099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2251171695649683099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/2251171695649683099'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/vba-will-be-back-for-mac-office.html' title='VBA will be back for Mac Office!'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-3416104726287528153</id><published>2008-05-13T08:10:00.002-04:00</published><updated>2008-05-14T13:04:06.735-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c"/><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><category scheme="http://www.blogger.com/atom/ns#" term="instant messaging"/><category scheme="http://www.blogger.com/atom/ns#" term="pidgin"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="rant"/><title type='text'>Pidgin plugins, a how-to and rant (part 1)</title><content type='html'>I&#39;m finding out what a joy it is to write a plugin for &lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=8208301773917930821&quot;&gt;pidgin&lt;/a&gt;. For those unaware of what that is, it is an opensource instant messaging program that lets you use multiple IM protocols (AIM, YahooIM, MSN Messenger, etc). If you&#39;ve heard of something called Trillion, it is similar to that. It used to be called Gaim.&lt;br /&gt;&lt;br /&gt;Anyways.. here is my problem. I have my power management set up to turn off the monitor after 10 minutes of activity. When I&#39;m home and not using the computer, and someone sends me an IM, I don&#39;t usually see it until I use the computer again (or if I get an email, but I&#39;ll explain that later). I don&#39;t like that. I know I could turn it off, but I&#39;m not gonna do that. So I need to figure out a workaround.&lt;br /&gt;&lt;br /&gt;I have my email checking program set up to flash the &quot;scroll lock&quot; on the keyboard when I get an email so the screen saver / power management turns off, like someone is pressing the key every second. So last night I thought, why can&#39;t I set up a plugin for pidgin to do something similar? I&#39;ve never written anything for it before, but since the capability is there and I can stumble through enough c to write the code for it I thought it made sense.&lt;br /&gt;&lt;br /&gt;Then I dove into it. Went on the &lt;a href=&quot;http://developer.pidgin.im/wiki/CHowTo&quot;&gt;pidgin developer site&lt;/a&gt;, looked at the plugin code samples, and realized it was going to be tougher than I thought. The API wasn&#39;t very well documented, and the outdated examples (when not &quot; This page is a placeholder pending the completion of this document.&quot; -July2007) weren&#39;t much help. I managed to write the code for it using the samples there and &lt;a href=&quot;http://randomfox.livejournal.com/15169.html&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;some code on some guy&#39;s blog&lt;/span&gt;&lt;/a&gt;, then came time to compile it.&lt;br /&gt;&lt;br /&gt;If you&#39;re a developer of any kind and have a couple free minutes, take a look at the pidgin developer site and see if the compilation instructions make much sense to you. They aren&#39;t totally incoherent, but far from straight forward.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Install &lt;a href=&quot;http://cygwin.com/&quot;&gt;cygwin&lt;/a&gt; to create a linux-like build environment. The setup of that program was not the friendliest I&#39;ve used, but I got through it as well as adding the non-default (but necessary for my case) cygwin packages (&lt;strong&gt;&lt;/strong&gt;make, patch, monotone, unzip, wget)&lt;/li&gt;&lt;li&gt;Running the &lt;a href=&quot;http://gaim-extprefs.sourceforge.net/bef.shtml&quot;&gt;windows pidgin build environment fetcher&lt;/a&gt; using my new cygwin shell to get the needed dependencies (another time-consuming process in itself since it was my first use of it). I especially loved the yes/no question that only allowed &quot;[p/n]&quot; as answers.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A few compile issues that were no fault of mine, but still had to be researched (and researched) online to figure out how to get it to compile. Finally got down to a single compile error (dealing with ld.exe and -lpurple) and I couldn&#39;t figure out how to fix it.&lt;br /&gt;Hours later and I was no further along.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;After a bit of time setting up a build environment and then figuring out how cygwin worked, I had made headway. Unfortunately that error (&quot;ld.exe: cannot find -lpurple&quot;) kept me dead in the water, and I had to get some sleep. I&#39;ll try more tonight after work I suppose.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/3416104726287528153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/3416104726287528153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/3416104726287528153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/3416104726287528153'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/pidgin-plugins-how-to-rant_13.html' title='Pidgin plugins, a how-to and rant (part 1)'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-6913616169036632469</id><published>2008-05-12T16:14:00.002-04:00</published><updated>2008-05-12T19:57:32.335-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><title type='text'>My firefox extensions</title><content type='html'>Since that last post mentioned two extensions I use, I thought I&#39;d throw this out there.&lt;br /&gt;&lt;br /&gt;Here are the extensions I use on this computer, my others have a slightly different setup but pretty much the same:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Adblock Plus -- I don&#39;t block the adsense ones, but I do block some of the more annoying javascript ones on some other pages, that only get in my way and/or make some sort of sound.&lt;/li&gt;&lt;li&gt;DOM Inspector -- I think this one is basically included with FireFox&lt;/li&gt;&lt;li&gt;Download Statusbar -- I found this one a few weeks ago, loving it. The downloads window always seemed to annoy me before, this seems like a happy medium.&lt;/li&gt;&lt;li&gt;LinkVisitor -- I don&#39;t really use this one much anymore (still enabled), I was using this while trying to clean up my history file (lots of &quot;invisible&quot; ad sites in there that bloated my history.dat file, making FF freeze anytime I happened to click the History commandbar). I mostly use this for the &quot;mark all links as read&quot; (which also adds them to the history)&lt;/li&gt;&lt;li&gt;Gmail Notifier -- So simple but so useful&lt;/li&gt;&lt;li&gt;Google Reader Watcher -- Same&lt;/li&gt;&lt;/ul&gt;What extensions do you use and/or love? I used to use FasterFox until I realized that it actually seems to slow FF down. Anyone know of an extension that just times the page load, and nothing else?</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/6913616169036632469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/6913616169036632469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6913616169036632469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6913616169036632469'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/my-firefox-extensions.html' title='My firefox extensions'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-6010325119675557390</id><published>2008-05-12T15:41:00.014-04:00</published><updated>2008-05-13T13:47:35.161-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adsense"/><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="rss"/><title type='text'>Google AdSense</title><content type='html'>Ok, so I decided I&#39;d add Google AdSense here. If anyone thinks I should remove the ads (if people start actually reading this), just let me know. If I get $0.02/year, I&#39;ll be happy. Who knows, maybe you&#39;ll find something you want to buy.&lt;br /&gt;&lt;br /&gt;Rather than have a small post here, I thought I&#39;d share my love of Google as well. It has been my homepage for a while, and now that I&#39;ve got my iGoogle customized with my Gmail, Google reader, Google weather, and numerous direct news feeds and what not I only need to really check the one page for any of my &#39;essentials&#39;. Plus there is their Blogger and Picasa tools, Google Docs, Google news, and of course their search.&lt;br /&gt;&lt;br /&gt;Add in the Firefox extensions for Google Reader and Gmail, and you&#39;re good to go!  I should buy some Google stock.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/6010325119675557390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/6010325119675557390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6010325119675557390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6010325119675557390'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/adsense-google.html' title='Google AdSense'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-1303334256787029444</id><published>2008-05-12T13:23:00.001-04:00</published><updated>2008-05-12T14:07:52.883-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mario kart"/><category scheme="http://www.blogger.com/atom/ns#" term="wii"/><title type='text'>Mario Kart Wii</title><content type='html'>Great game! If you&#39;ve ever played a mario kart game before, you&#39;ll love this. It keeps most of the same gameplay from previous versions (less some character specific items, and unfortunately no 2-player grand prix), but adds &lt;span style=&quot;font-weight: bold;&quot;&gt;internet play&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;I tried the wheel for a while and got pretty good with it, but honestly I prefer using the wiimote with a nunchuck. The little white or gold wheel next to my name online does nothing for me, so I see no benefit to using it.&lt;br /&gt;&lt;br /&gt;It does take quite a few hours to unlock everything in it, and I don&#39;t even have it all just yet (all but 2 characters and 1 car -- out of the 16 unlockable tracks, 16 unlockable characters, and 18 unlockable vehicles {9 karts, 9 bikes}).&lt;br /&gt;&lt;br /&gt;Overall it is immensely fun. I just need to get more people I know to buy it...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Got the game? Send me your license number!</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/1303334256787029444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/1303334256787029444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/1303334256787029444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/1303334256787029444'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/mario-kart-wii.html' title='Mario Kart Wii'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-8422581116425516505</id><published>2008-05-12T11:32:00.003-04:00</published><updated>2008-05-13T13:46:53.227-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="guild wars"/><category scheme="http://www.blogger.com/atom/ns#" term="mario kart"/><category scheme="http://www.blogger.com/atom/ns#" term="new computer"/><category scheme="http://www.blogger.com/atom/ns#" term="office"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><category scheme="http://www.blogger.com/atom/ns#" term="xp64"/><title type='text'>New Computer</title><content type='html'>Well, I got a new computer a couple weeks ago and have been slowly integrating it into my normal usage.  It didn&#39;t help that the parts came over the course of a week (most in the first 2 days, save some necessary sata cables that rendered the rest of it useless), and that my pretty new monitor (hp w2207) worked well with my old pc, delaying my motivation/installation.  For those that are curious/bored, heres the specs on my new computer:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CPU: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16819115037&quot;&gt;Intel E8400&lt;/a&gt; -- 3.0ghz core 2 duo, fast goodness&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Motherboard: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16813131232&quot;&gt;ASUS nForce 750i&lt;/a&gt; -- Does everything I need and much more (everything I &lt;span style=&quot;font-style: italic;&quot;&gt;may&lt;/span&gt; need someday?)&lt;/li&gt;&lt;li&gt;RAM: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16820231122&quot;&gt;G.Skill 4GB&lt;/a&gt; -- Nothing too special here, 4gb of DDR2 800 PC2 6400. Works very well though and no issues installing it at all&lt;/li&gt;&lt;li&gt;Video Card: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16814130319&quot;&gt;eVGA GeForce 8800GT&lt;/a&gt; -- Sweeeeeeeeeet card. I&#39;m immensely impressed at what this thing can do. PCIx 2.0x16, 512mb, 256bit, GDDR3, HDCP, SLI; this should keep my graphics near-high-end for years&lt;/li&gt;&lt;li&gt;Monitor: &lt;a href=&quot;https://www.tigerdirect.com/applications/SearchTools/item-details.asp?Sku=H25-2200&quot;&gt;HP w2207&lt;/a&gt; -- Great monitor. Get one. Actually, why not get two? 22&quot; widescreen LCD, 1680x1050, 1000:1, DVI or VGA input, even has USB ports and can be easily rotated to be in Portrait mode instead of the usual landscape mode (VERY useful for long spreadsheets and web pages)&lt;/li&gt;&lt;li&gt;Hard Drive: &lt;a href=&quot;https://www.tigerdirect.com/applications/SearchTools/item-details.asp?Sku=TSD-500AAKS%20TD&quot;&gt;WD Caviar 500gb sata 7200/16mb&lt;/a&gt; --Just a big hard drive.. I had read a bunch of good reviews, so I got one. Actually I bought this last Friday and should get it tomorrow hopefully, currently have an old 120gb drive in the machine right now (which will stay, my OS is on it)&lt;/li&gt;&lt;li&gt;DVD/CD drive: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16827151154&quot;&gt;Samsung DVD burner&lt;/a&gt; -- Just a fast, robust, sata dvd burner. Lots of good features on it, though I&#39;ve only used it so far for reading cds/dvds and haven&#39;t burned anything yet. Soon enough, I&#39;m sure, as I can&#39;t wait to try the dual layer. Hoping the lightscribe isn&#39;t just marketing hype&lt;/li&gt;&lt;li&gt;Case/PSU: &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16827151154&quot;&gt;CoolerMaster RC-690-KKA1-GP&lt;/a&gt; -- Big case (bigger than I was expecting :/), lots of great tool-less features and lots of room for fans. Included a few fans to begin with, as well as a 550w PSU, plus external ports. And it is black. I guess the only thing I don&#39;t like is the neon blue glowing in the front, but certainly not enough to want a new one. Way too many positives outweight it.&lt;/li&gt;&lt;/ul&gt;So yeah, that is it. Installed XP x64 on it, Firefox, Visual Studio 2008, Office 2007 ultimate (woo!), and Guild Wars. Haven&#39;t tried that other than just a quick check to see how it looked, which was much better than my old pc. The release of Mario Kart Wii kinda curbed my enthusiasm for the new computer, it&#39;ll return soon enough I&#39;m sure.&lt;br /&gt;&lt;br /&gt;Oh, and I got a USB wi-fi adapter for it too, in case I decide not to anchor it near my router. Much better than the one I had anyways for my laptop, so it was money well spent.&lt;br /&gt;&lt;br /&gt;Overall, the computer was a little more than I had planned to spend, but if nothing else I can thank the $600 economic stimulus refund I got, and simply write the monitor off as a personal 30th birthday present.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/8422581116425516505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/8422581116425516505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8422581116425516505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/8422581116425516505'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/05/new-computer.html' title='New Computer'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8208301773917930821.post-6411258399198665010</id><published>2008-04-28T11:51:00.001-04:00</published><updated>2008-05-13T13:46:42.520-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="mork"/><category scheme="http://www.blogger.com/atom/ns#" term="rant"/><title type='text'>Firefox history.dat file</title><content type='html'>Mork sucks.</content><link rel='replies' type='application/atom+xml' href='http://mvxl.blogspot.com/feeds/6411258399198665010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8208301773917930821/6411258399198665010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6411258399198665010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8208301773917930821/posts/default/6411258399198665010'/><link rel='alternate' type='text/html' href='http://mvxl.blogspot.com/2008/04/firefox-historydat-file.html' title='Firefox history.dat file'/><author><name>mvidas</name><uri>http://www.blogger.com/profile/18016501525468502564</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>