Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pasted below is code that when ran is resulting in a "Run-Time error '1004'
Unable to get the VLookup property of the WorksheetFunction Class." The problem is in the string of code where I am trying to apply a password to a file based on a result from a vlookup. Can someone help me get this corrected, I believe I am very close...thanks. Sub Protect_File_Labor() Dim sCurrFName As String Dim X As Integer Dim Y As Range Set Y = Range("d17") With Application .ScreenUpdating = False .DisplayAlerts = False sCurrFName = Dir(Y.Value & "*.xls") Do While sCurrFName < "" Workbooks.Open (Y.Value & sCurrFName) Workbooks(sCurrFName).SaveAs (Y.Value & sCurrFName), Password:=WorksheetFunction.VLookup(sCurrFName, Range("k1:l3"), 2, 0) Workbooks(sCurrFName).Close sCurrFName = Dir Loop .ScreenUpdating = True .DisplayAlerts = True End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why do I get VLookup error 1004 | Excel Discussion (Misc queries) | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
I got this problem run-time error 1004 application defined ... | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel |