的陣列,我有以下工作表的數組:創建電子表格
Dim ArrayOne(11) As Worksheet
ArrayOne(0) = "January 2015"
ArrayOne(1) = "February 2015"
ArrayOne(2) = "March 2015"
ArrayOne(3) = "April 2015"
ArrayOne(4) = "May 2015"
ArrayOne(5) = "June 2015"
ArrayOne(6) = "July 2015"
ArrayOne(7) = "August 2015"
ArrayOne(8) = "September 2015"
ArrayOne(9) = "October 2015"
ArrayOne(10) = "November 2015"
ArrayOne(11) = "December 2015"
,當我試圖做到以下幾點:
Set ArrayOne(1) = Sheets.Add
Sheets.Add.Name = ArrayOne(1)
ArrayOne(1).Protect DrawingObjects:=False, Contents:=False, _
它給了我一個錯誤:
Object variable or With block variable not set
而這裏的錯誤點:
ArrayTwo(0) = "January 2015"
謝謝!那完美的工作! – Jack
只是一個簡單的問題,我是否甚至需要這個 - > strArrayone(1).Protect DrawingObjects:= False,內容:=假,_ – Jack
如果你只是添加一個不受保護的工作表並命名它,那麼我沒有看到任何該行代碼的原因。你究竟想要做什麼? – BrandonCoder