Board logo

標題: [分享] vba 執行螢幕問題 [打印本頁]

作者: asoonla    時間: 2012-1-5 18:20     標題: vba 執行螢幕問題

Sub NextRun()
    NextTime = Now + 5 / 86400
    Application.OnTime NextTime, "Macro1"
End Sub

=================================
Sub Macro1()
    Application.DisplayFullScreen = True
End Sub
===============

我寫了一個可以時間一到,便可執行全螢幕的巨集,
然而要點excel的程式時他才會顯示全螢幕
請問有無任何方式可以讓他自然顯示全螢幕呢??
例如打bbs打到一半他便自動跳出excel的全螢幕呢??
受教了~
作者: Hsieh    時間: 2012-1-6 10:06

回復 1# asoonla

試試
  1. Public Declare Function SetWindowPos Lib "user32" _
  2. (ByVal hwnd As Long, ByVal hwndinsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  3. Sub nn()
  4. Application.OnTime Now + TimeValue("00:00:30"), "ex"
  5. End Sub

  6. Sub ex()
  7. With ThisWorkbook.Application
  8. hw = .hwnd
  9. SetWindowPos hw, -1, 0, 0, 0, 0, 3
  10. .DisplayFullScreen = True
  11. End With
  12. End Sub
複製代碼

作者: asoonla    時間: 2012-1-7 14:02

感謝....想不到是用這樣的方式




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)