VBA中历遍文件夹中的图片为什么第二个就失效了?myfile成了空值!哪里出了问题?

896℃ AL

VBA中历遍文件夹中的图片为什么第二个就失效了?myfile成了空值!哪里出了问题?

在VBA中用Dir历遍包含子文件夹的所有文件,指定文件类型后就不历遍子文件夹了。请大神之招。代码如下:

Sub ScearchFiles_AndSub()

    Dim x%, i%

    With Application.FileDialog(msoFileDialogFolderPicker)

        If .Show = -1 Then

            P = .SelectedItems(1)

            If Right(P, 1) = "\" Then P = P Else P = P & "\"

        End If

    End With

'------------------------------------------------------------------------------

    Set FolderList = CreateObject("Scripting.Dictionary")

    FolderList.Add P, ""

    i = 0

    Do While i < FolderList.Count

        Ke = FolderList.Keys

        'FName = Dir(FolderName, vbDirectory + vbHidden + vbNormal)

        FName = Dir(Ke(i), vbDirectory)

            Do While FName <> ""

                If FName <> ".." And FName <> "." Then

                    If GetAttr(Ke(i) & FName) And vbDirectory Then

                        FolderList.Add (Ke(i) & FName & "\"), ""

                    End If

                End If

                FName = Dir

            Loop

        i = i + 1

    Loop

'------------------------------------------------------------------------------

    For Each Fn In FolderList.Keys

        FName = Dir(Fn & "*.pdf")

        Do While FName <> ""

            Cells(x + 1, 1) = FName

            x = x + 1

            FName = Dir

        Loop

    Next

End Sub

Excel保存的html文件时生成的.file文件夹里面的图片为什么有两个格式的(一个png格式,一个jpg格式)?

一个是缩略图,一个是原图,大小不一样的。

为什么我做好并且保存的excel文件,再次打开就成了图片?别人发过来的e

看起来是你变更了打开文件的方式,改变方法为:

1、鼠标右键点击文件,选择 “”属性“”;

2、在属性标签中 的 “”常规“”中找到 “”打开方式“”选择右侧的 “”更改“”;

3、在 列表中选择用来打开文件的程序,一般是 EXCEL(也有人用WPS)

各位大侠们,excel文件上传到服务器上,再打开时为什么里面的图片就没了?先谢谢了。。。

rld1的图片也上传到服务器的同一目录下