VB getsaveasfilename弹出的对话框为什么总是躲在主窗体后面啊?
SetnewAp=NewExcel.ApplicationSetnewbook=newAp.Workbooks.AddSetnsheet=newbook.Workshee...
Set newAp = New Excel.Application
Set newbook = newAp.Workbooks.Add
Set nsheet = newbook.Worksheets.Add
.......
excelfilename = newAp.GetSaveAsFilename("标签", "Microsoft Excel(*.xlsx),*.xls", , "保存")
If excelfilename <> "False" Then
newbook.saveas excelfilename
Else
newbook.Saved = True
End If
调试运行时没问题,“保存”对话框都弹出在前端,编译生成.exe文件运行后就一直躲在主窗体后面,这是怎么回事? 展开
Set newbook = newAp.Workbooks.Add
Set nsheet = newbook.Worksheets.Add
.......
excelfilename = newAp.GetSaveAsFilename("标签", "Microsoft Excel(*.xlsx),*.xls", , "保存")
If excelfilename <> "False" Then
newbook.saveas excelfilename
Else
newbook.Saved = True
End If
调试运行时没问题,“保存”对话框都弹出在前端,编译生成.exe文件运行后就一直躲在主窗体后面,这是怎么回事? 展开
1个回答
展开全部
Private Sub Command1_Click()
Set newAp = New Excel.Application
Set newbook = newAp.Workbooks.Add
Set nsheet = newbook.Worksheets.Add
'.......
excelfilename = newAp.GetSaveAsFilename("标签", "Microsoft Excel(*.xlsx),*.xls", , "保存")
If excelfilename <> "False" Then
newbook.saveas excelfilename
Else
newbook.Saved = True
End If
End Sub
我编译了,弹出对话框在前端啊。你还有其他代码干扰吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询