Problems related to KB973475 and KB973593

Hi All,

Many users (including customers of mine) have experienced trouble with two recent security updates by Microsoft, see:

http://support.microsoft.com/kb/973475

and

http://support.microsoft.com/kb/973593

There seem to be two hotfixes to this problem:

KB973475 Excel 2003 hotfix package :

http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=978908&kbln=en-us

KB973593 Excel 2007 hotfix package :

http://support.microsoft.com/default.aspx?scid=kb;EN-US;978522

If you experience problems with your Excel, check if you have this update and if so, download the hotfix.
For other problems related to starting and stopping Excel, see:

http://www.jkp-ads.com/Articles/StartupProblems.asp

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

Capitalizing Web Addresses

In written correspondence, which is best:

  1. dailydoseofexcel.com
  2. DailyDoseofExcel.com
  3. DailyDoseOfExcel.com
  4. www.dailydoseofexcel.com
  5. www.DailyDoseofExcel.com
  6. www.DailyDoseOfExcel.com
  7. http://dailydoseofexcel.com
  8. http://DailyDoseofExcel.com
  9. http://DailyDoseOfExcel.com
  10. http://www.dailydoseofexcel.com
  11. http://www.DailyDoseofExcel.com
  12. http://www.DailyDoseOfExcel.com

I personally prefer #1, all lowercase and no unnecessary prefix. But I think I’m in the minority. One of the capitalized ones is probably easier to read, but I’m no sure about the “of”. Thoughts?

Opening Files on Startup

Let’s say that you want to open a specific file when you start Excel. Here are some options:

XLSTART

If you have Excel installed, you have a folder called XLSTART. Mine’s here C:\Documents and Settings\Dick\Application Data\Microsoft\Excel\XLSTART\. On my Windows 7 machine running Office 2010 Beta, it’s here C:\Program Files\Microsoft Office\Office14\XLSTART\. (Are we putting data files under Program Files again?)

Any file you put in XLSTART will open automatically when you start Excel. The next time your coworker leaves his workstation unattended, put a couple hundred CSV files in his XLSTART folder. You’ll be the office comedian.

Alternate Startup Location

2003: Tools – Options – General – At startup, open all files in:
2007: Office Orb – Excel Options – Advanced – General – At startup, open all files in:
2010: File – Options – Advanced – General – At startup, open all files in:

Works just like XLSTART, but you can leave this textbox blank (it is by default).

Here’s some other stuff I wrote on XLSTART and Alternative Startup Locations.

Shortcuts

You can make a new shortcut with the following Target "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" "C:\Documents and Settings\Dick\My Documents\multiplelookups.xls".

That will open multiplelookups.xls whenever you use this shortcut to open Excel. You could also just use the file name without the executable as long as your file associates are correct. If you don’t know what file associations are, they’re probably OK.

Auto_Open

Do you already have a workbook or add-in that opens automatically? I have a bunch, but the easiest one for me to modify is PERSONAL.XLS. I can create a new module in my PMW and put in a macro that opens a workbook by following these steps:

  1. From Excel, press Alt+F11 to open the VBE
  2. Press Control+R to show the Project Explorer if it’s not already showing
  3. Find PERSONAL.XLS (or whatever workbook opens for you at startup) in the Project Explorer and select it. Make sure that the file name in the title bar is correct.
  4. From the Insert menu, choose Module
  5. In the code pane, type something like

    Sub Auto_Open()

    Workbooks.Open "C:\Documents and Settings\Dick\My Documents\multiplelookups.xls"

    End Sub

    Make sure it’s called Auto_Open because that’s Excel’s trigger to run it on startup.

  6. Still in the VBE, from the File menu, choose Save PERSONAL.XLS
  7. Press Alt+F4 to close the VBE and return to Excel

Now whenever you start Excel, the Auto_Open code will run and your file will open.

Open Event

This is like Auto_Open. Instead of inserting a new Module, locate the ThisWorkbook module and open it. At the top of the code pane, there are two drop down boxes. Select Workbook from the left one and Open from the right one. Was Open already in the right one? That’s OK. Now type that same one line of code from above so that your module looks like this


Private Sub Workbook_Open()

Workbooks.Open "C:\Documents and Settings\Dick\My Documents\multiplelookups.xls"

End Sub

Like Auto_Open, this code will run whenever PERSONAL.XLS is opened.

That’s all the ways I can think of to open a file when Excel opens. What did I miss?

2009 in Review

Top 10 Page Views in 2009

Post Page Views
Creating CSV Files 33,947
Sumif Between Two Dates 19,336
Number Stored as Text 15,003
Writing to a Range Using VBA 12,165
Automating Internet Explorer 11,248
Progress Bar 11,212
Testing for Empty Cells 10,581
Pattern Matching 9,665
Calculated Fields in Pivot Tables 9,321
Maxif Minif Functions 8,162

Most Viewed 2009 Posts

Post Page Views
Vlookup on Two Columns 6773
Vlookup 2695
Get the Path to My Documents in VBA 2258
Excel Sample Data 2230
Reading Xml Files in VBA 1710
Bingo 1673
Illegal Range Names 1576
Creating State Maps with XY Charts 1570
Historical US Tax Rates 1564
Work Breakdown Structure Numbering in Excel 1451

Most Commented Posts

Post 2009 Comments
SUMIF Between Two Dates 51
ADO Slower on Linked Tables 33
Removing Spaces from File Names 32
Hello World Button on a Ribbon 30
WordPress Upgrade 29
One Keyboard Shortcut 29
Illegal Range Names 27
Adding Every Other Cell 27
Summing the Digits of a Number 27
Programming Music 26

For the first two tables, I copied tables out of Google Analytics, messaged them with Quick TTC, and created the html tables with JoinRange, like

=PERSONAL.XLS!joinrange(C1:D1,”< /td>< td>”,”< tr>< td>”,”< /td>< /tr>”)

For the comment counts, I used this sql statment

SELECT wp_posts.post_title, wp_posts.post_date, wp_posts.post_name, count(wp_comments.comment_id) AS comment_count
FROM wp_posts INNER JOIN wp_comments ON wp_posts.id=wp_comments.comment_post_id
WHERE year(wp_comments.comment_date)=2009
GROUP BY wp_posts.post_title, wp_posts.post_date, wp_posts.post_name
ORDER BY comment_count DESC

I probably should have only included approved comments, but it’s close enough for government work.

New YearÂ’s Resolution: No More Offset

On Simon’s blog, sam comments regarding OFFSET vs. INDEX:

There is a huge performance hit.

You will notice hardly any difference in the Calculation times

But the recalculation times will significantly different in case of OFFSET- to the tune of 25-30 times slower compared Index.

I’ve heard this many times before, but I guess I’m just lazy. I’ve continued to use OFFSET when defining range names. Here’s the code I used to test what he said.

Sub TestVolatile()
   
    Dim wb As Workbook
    Dim aWrite(1 To 65000, 1 To 1) As Double
    Dim i As Long
    Dim clsTimer As CTimer
   
    Set clsTimer = New CTimer
   
    For i = LBound(aWrite, 1) To UBound(aWrite, 1)
        aWrite(i, 1) = i
    Next i
   
    Set wb = ActiveWorkbook
    wb.Sheets(1).Range(“A1:A65000”).Value = aWrite
   
    For i = 1 To 10
        clsTimer.StartCounter
        wb.Names.Add “MyVol”, “=OFFSET($A$1,0,0,COUNTA($A:$A),1)”
        wb.Sheets(1).Range(“B1:B10”).Formula = “=COUNTA(MyVol)”
        Debug.Print “OFFSET Calc”, clsTimer.TimeElapsed
       
        clsTimer.StartCounter
        Application.CalculateFull
        Debug.Print “OFFSET Recalc”, clsTimer.TimeElapsed
       
        clsTimer.StartCounter
        wb.Names.Add “MyVol”, “=$A$1:INDEX($A:$A,COUNTA($A:$A))”
        Debug.Print “INDEX Calc”, clsTimer.TimeElapsed
       
        clsTimer.StartCounter
        Application.CalculateFull
        Debug.Print “INDEX Recalc”, clsTimer.TimeElapsed
    Next i
   
End Sub

And here’s the results I got

I must be using a slightly different method, but the results still point to INDEX as being more efficient.

The timer code comes from Mike Woodhouse via StackOverflow.