[求助]代码和系统有关么
Sub 製作excel文本()Set newBook = Workbooks.Add
With newBook
.Title = "1995 Sales"
.Subject = "Sales"
.SaveAs Filename:="d:\銀行.xls"
.Subject = "sheets"
Windows("銀行.xls").Activate
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "支票"
End With
With newBook.VBProject.VBComponents.Item("ThisWorkbook").CodeModule
.InsertLines 2, "Private Sub Workbook_Open()"
.InsertLines 3, "Range(cells(1.1),cells(1.3)).Select"
.InsertLines 4, "Selection.ClearContents"
.InsertLines 5, "cells(1,1).value=1"
.InsertLines 6, "End Sub"
End With
End Sub
在中文XP系统下时,这段代码能运行,但是日文系统下运行到With newBook.VBProject.VBComponents.Item("ThisWorkbook").CodeModule这句就出错了,不知道为什么,有高手能告诉我不,怎么改才行呢?