Dim fp As String ="D:\" & dr("零件号") 要判断一下是否存在这个文件夹,如果没有要先创建
其次
For i As Integer = 0 To 30 For j As Integer = 0 To 25 Dim fp As String ="D:\" & dr("零件号") If Sheet(i,j).SaveImage(fp & "\" &i & j & ".jpg" ) Then dr("照片") = FileSys.GetName(fn) & vbcrlf & dr("照片")