I am trying to open a file and hide all rows where the value in the cell in column A is NOT "1" - this is what I have written but it is not working - (it works as a macro within Excel but I need to call if from an Access Module)... take a peek:
Any help would be greatly appreciated.
JoKo
John Kolker
Programmer
jwkolker@comcast.net
Code:
Public Function testhide()
Dim XL As Object
Dim xlCellTypeFormulas As Property
***This may be where the problem is *****
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open "MyFileName.xls"
'Hides all rows that are empty
XL.Application.Visible = True
****This line is here so I can see the macro do it's thing
I will remove it after it is all working***
XL.Application.Goto Reference:="fronthome"
XL.Columns("A:A").Select 'Assuming print markers there
XL.Selection.SpecialCells(xlCellTypeFormulas, 1).Select
XL.Selection.EntireRow.Hidden = True
End Function
Any help would be greatly appreciated.
JoKo
John Kolker
Programmer
jwkolker@comcast.net