Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Excel Macro from VBA Access - Help with Settings...

Status
Not open for further replies.

jwkolker

Programmer
Jan 9, 2003
68
US
Need 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:


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top