Any advice?
Yes, bookmark the online 2003 Excel Visual Basic Reference or download the 2003 Excel Visual Basic Reference help file. They aren't entirely up to date with 2010, but the vast majority of the core functionality is the same, and you will want these references around to help you.
In your case, the problem is not the variable After, it's the fact that VBA can utilize named parameters for its functions, but AHK cannot use them in that same way; AHK has to use the parameters in order. So in the case of the Add method:
expression.Add(Before, After, Count, Type)
So we just need to fill in the second parameter. But before we tackle this, you need to be aware of another AHK function used to deal with optional parameters we intend to skip. This function is ComObjMissing(), which we can save to a variable. We need this because we would like to skip the first parameter and use only the second parameter.
So let's take a look at a piece of sample code as written in AHK based on your needs, which assumes that you already have a workbook open and it is the active workbook:
xl := ComObjActive("Excel.Application") ; connects to the active instance of Excel
, _ := ComObjMissing() ; saving the capability to "skip" a parameter to var
xl.Sheets.Add(_,2) ; adds a sheet after the second sheet
But now as regards the code from the macro recorder:
Sheets.Add After:=Sheets(Sheets.Count)
You'll need to do something slightly different:
xl := ComObjActive("Excel.Application") ; connects to the active instance of Excel
, _ := ComObjMissing() ; saving the capability to "skip" a parameter to var
xl.Sheets.Add(_,xl.Sheets.Count) ; adds a sheet after the last sheet
HTH