Login | |
|
 |
Excel filter error - 7/2/2008 11:34:49 PM
|
|
 |
|
| |
stubar
Posts: 48
Score: 0
Joined: 7/14/2005
Status: offline
|
Hello I have an hta that helps check multiple login scripts. It goes off to the PDC copies the bat files into a folder and generates a specific line in them, if it exists, with an option to view the whole script. Everything works as it should. However, when I added a sub to export the data to Excel I ran into a problem. I thought if recorded a macro and then used that in my script it would work, alas no. Some does, some doesn't. This is the sub and the section in red generates the error. REM that line and it works. Sub ExportFiles Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add intRow = 2 objExcel.Cells(1, 1).Value = "O Drive" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("Export.txt", 1) Do Until objFile.AtEndOfStream StrODrives = objFile.ReadLine objExcel.Cells(intRow, 1).Value = StrODrives intRow = intRow + 1 ' next Loop objExcel.Columns("A:A").Select objExcel.Cells.EntireColumn.AutoFit objExcel.Selection.AutoFilter ' REM objExcel.Selection.AutoFilter Field:=1, Criteria1:="=*persi*", Operator:=xlAnd objExcel.Range("d12").Select End Sub
|
|
| |
|
|
|
 |
RE: Excel filter error - 7/3/2008 12:45:29 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Look in the Office install folder. For me it is : C:\Program Files\Microsoft Office\OFFICE11\1033 In there you will find several help files. In your case the VBAXL10.CHM file is the Excel VBA object model that would tell you what you need.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|