|
之前没有设置dlgx.Title属性,第一次调整窗口大小后,下次运行大小为最后一次调整的大小。
修改之后,每次弹窗都会恢复系统默认大小,每次都要拉开,不方便查看。请各位帮帮忙看看怎么设置。
Sub 电子发票处理()
Dim i As Integer, str As String, fol As String, n1 As String, n2 As String
Sheet7.Activate
For i = 2 To ActiveSheet.UsedRange.Rows.Count
If InStr(Cells(i, 3), "电子") Then
If MsgBox("发票“" & Cells(i, 5) & "”是否有原始发票?", vbOKCancel) = vbOK Then
Set dlgx = Application.FileDialog(msoFileDialogOpen) '创建filedialog对象,这是你要引用的文件
dlgx.Title = "请选择发票编码:" & Cells(i, 5) & " 发票金额:" & Cells(i, 9) '指定窗口名称
dlgx.InitialFileName = "C:\Users\Administrator\Desktop" '指定路径,文件名和过滤字符也在此指定,如C:\*.TXT
If dlgx.Show = -1 Then Cells(i, 1) = dlgx.SelectedItems(1)
End If
End If
Next i
[a1] = [a1] & Chr(10) & "电子发票已存档"
End Sub
|
|