因为要固定excel的前2行,我加了以下的代码
.Rows("3:3").Select
ActiveWindow.FreezePanes = True(问题出在这一行)
先说明一下,在加这两行代码以前进程的excel可以关闭,加了以后,以下的代码也执行了,就是不关闭进程
xlsApp.DisplayAlerts = False
Set xlsSheet = Nothing
xlsBook.Close
Set xlsBook = Nothing
xlsApp.Quit
Set xlsApp = Nothing
大家还有什么固定行的办法吗
.Rows("3:3").Select
ActiveWindow.FreezePanes = True(问题出在这一行)
先说明一下,在加这两行代码以前进程的excel可以关闭,加了以后,以下的代码也执行了,就是不关闭进程
xlsApp.DisplayAlerts = False
Set xlsSheet = Nothing
xlsBook.Close
Set xlsBook = Nothing
xlsApp.Quit
Set xlsApp = Nothing
大家还有什么固定行的办法吗
excel关闭了,可是进程没有关闭啊
ActiveWindow.FreezePanes = false后面再调用
xlsApp.DisplayAlerts = False
Set xlsSheet = Nothing
xlsBook.Close
Set xlsBook = Nothing
xlsApp.Quit
Set xlsApp = Nothing
xlBook.Save
xlBook.Close
xlExcel.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlExcel = Nothing
销毁应用程序对象以前应该再把这个赋True。
xlBook.Close
xlExcel.close
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlExcel = Nothing
ActiveWindow.FreezePanes = True(问题出在这一行)
先说明一下,在加这两行代码以前进程的excel可以关闭,加了以后,就是不关闭进程大家的方法我都试过了,不管用啊
再说明一下,我不加入固定前二行的时候,进程可以关闭继续等待中,如果分不够,我在加
如果是在VBA里面,这个是全局的,在VB里不是全局对象,可能会导致错误,在前面加上父级对象。Object.rows
ActiveWindow.FreezePanes = True改成:
xlsApp.ActiveWindow.FreezePanes = True