|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 liucqa 于 2011-9-6 09:17 编辑
楼主不是chinese吗,为啥有话不好好说,非让我看鸟文
exe里面就一个vbs文件
Dim oExcel,fn,fso
fn=Replace(WScript.ScriptFullName,Right(WScript.ScriptFullName,4),".xls")
on error resume next
Set oExcel = GetObject(,"Excel.Application")
if err.number<> 0 then Set oExcel =CreateObject("Excel.Application")
err.clear
oExcel.Visible=FALSE
REM set fso = oExcel.Workbooks.Open (fn,,,,"123")
set fso = oExcel.Workbooks.Open ("D:\餐饮系统\餐饮系统 v3.xls",,,,"d13579(8)")
rem oExcel.Visible=TRUE
Set oExcel = Nothing
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(WScript.ScriptName) '删除脚本自身
Wscript.Quit
隐藏菜单的代码可以借鉴
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public cmdBarFlag() As Boolean '标识工具条状态
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WS_CAPTION As Long = &HC00000
Private Const GWL_STYLE = (-16)
Private Const WS_EX_TOOLWINDOW As Long = &H80
Private Const WS_THICKFRAME = &H40000
Private Const WS_SIZEBOX = WS_THICKFRAME '隐藏 Excel 标题栏
Sub Fshiddenbar() 'hidden all bar
hMenu = FindWindow(FindWindow("XLMAIN", Application.Caption), 0)
RemoveMenu hMenu, &HF060, MF_BYCOMMAND
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.DisplayFormulaBar = False
SetBar 0
Application.DisplayFullScreen = True
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayWorkbookTabs = False
Application.Caption = "餐饮系统"
End Sub
|
|