IntroductionGetting StartedAll PostsNotesAbout The Author
September, 2009
RSS
Storing/Retrieving Data To/From A Text File
Monday, September 28, 2009 - 9:38 AM

This example of the code was for a shared comment history used in mutliple workbooks – also see "Requesting, Storing, And Retrieving User Settings" under the User Interfaces category of this site.


Option Explicit
Option Base 1


'the code in this module requires a reference to zaksCollection.dll
'the dll can be found here: http://www.zaks.demon.co.uk/code/cpts/coll/

Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength&, ByVal lpBuffer$) As Long


Private

Extending Excel With Other MS Office Components
Monday, September 28, 2009 - 8:24 AM

Most Excel programmers will at least occasionally need to automate something in Word, Outlook, PowerPoint, or Project as part of their Excel applications. This post addresses all of the standard components of MS Office that include VBA (there is no VBA for Visio). I suggest you read all sections of this post even if you're currently only interested in one of the applications, because there are comments in some sections that apply to other sections as well.

Access
Access is by far the

Controling The VBE
Friday, September 25, 2009 - 1:43 PM
This is useful for hiding the VBE after code stops (do to a "Stop" statement, because the user interrupted the code, or because of an error).


Public
gvTestVBEAccess As Boolean


Public Function HideVBE()
    On Error Resume Next
    If fTestVBEAccess Then Application.VBE.MainWindow.Visible = False
End Function


Private Function fTestVBEAccess()
As Boolean
'returns true if the project isn't locked
'uses gvTestVBEAccess public boolean for sake of speed
   
Creating Outlook Messages With HTML Formatted Ranges
Friday, September 25, 2009 - 1:41 PM

Public Function CreateHTMLTable$(strRangeReference$, Optional WSName, Optional WBName, Optional HTMFilePath$, Optional HTMFileName$, _
    Optional TableName$)
'converts a range to HTML format, retaining all Excel formatting, and sends in an Outlook message
'requires references to Microsoft Outlook Object Library (msoutl9olb)
' and Microsoft Scripting Runtime (SCRRUN.DLL)
               

'uses TestLen

Reliable Worksheet Filtering With VBA
Friday, September 25, 2009 - 1:37 PM
Also see "cMatch and rMatch Functions". They can be used to identify column and row numbers to use for filtering, assuming there are no empty column or row headers in the filter range. (Check back soon for code to account for missing column and row headers.)

Filtering is also useful for charts because when rows and columns of data are filtered/hidden, the data series and points they contain are not displayed in charts using that data.


Option Explicit
Option Base
1


Public Const Show = True, Hide =
cMatch And rMatch Functions
Friday, September 25, 2009 - 1:06 PM
These functions facilitate using the extremely useful built-in 'match' function to identify column or row numbers for a supplied header. These functions accomplish the same objective as using named ranges for each column, but in an easier and better way. Header names may also be stored as public variables in your declarations module to prevent typos.

These functions can be used to identify column and row numbers to use for filtering, assuming there are no empty column or row headers in
6 records total        

January, 2009
February, 2009
March, 2009
April, 2009
May, 2009
June, 2009
July, 2009
August, 2009
September, 2009
October, 2009
November, 2009
December, 2009
IntroductionGetting StartedAll PostsNotesAbout The Author