Тэги:
#compile_error_wend_without_while_vba #compile_error_wend_without_while #excel_macro_compile_error_loop_without_do #vba_compile_error_loop_without_do #compile_error_next_without_for_vba #compile_error_loop_without_do_excel_vba #excel_macro_compile_error_for_without_next #compile_error_loop_without_do #compile_error_next_without_for #compile_error_in_excel_macro #what_is_a_compile_error_in_vba #macro #vba #Everydayvba #excel #vba_compile_error #macro_compile_error #compile_errorКомментарии:
How to resolve run time error 438
Ответитьfuck you man where is fixing???
Ответитьgive the solution instead of telling problems ?
ОтветитьHello, I have an issue with a loop. I have an End IF within my loop. I would like to add loop in another file with the exact same code. However I am getting the message for a Compile Error without Do. Here is my code with loop. FYI: This is my first time writing macros. Sub Auto_Open()
Dim FileSys As FileSystemObject
Dim objFile As File
Dim myFolder As Object
Dim strFilename As String
Dim dteFile As Date
Const myDir As String = "G:\S\Staffing\Attendance\July 2016"
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir)
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir)
dteFile = DateSerial(1900, 1, 1)
For Each objFile In myFolder.Files
If objFile.DateLastModified > dteFile Then
dteFile = objFile.DateLastModified
strFilename = objFile.path
End If
Next objFile
Workbooks.Open strFilename
Set FileSys = Nothing
Set myFolder = Nothing
Windows("dashboard.xlsm").Activate
End If
Loop
Dim FileSys As FileSystemObject
Dim objFile As File
Dim myFolder As Object
Dim strFilename As String
Dim dteFile As Date
Const myDir As String = "G:\S\Staffing\Headcount\July 2016 "
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir)
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir)
dteFile = DateSerial(1900, 1, 1)
For Each objFile In myFolder.Files
If objFile.DateLastModified > dteFile Then
dteFile = objFile.DateLastModified
strFilename = objFile.path
End If
Next objFile
Workbooks.Open strFilename
Set FileSys = Nothing
Set myFolder = Nothing
Windows("dashboard.xlsm").Activate
End If
Loop End Sub