View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Problem with Workbook_open

Which line caused the error?

(I'm still guessing that the worksheet is protected???)

Vick wrote:

I've tried using the code you suggested, but I received the same error. I
created a new sheet and it worked fine again. So I then changed the code to
look at sheet 2 and saved that excel file that worked with. Then when I
reopened it I received the same error. So I know the sheet is not protected
and it is not a chartsheet. Any other ideas?

Thanks

Vick

"Dave Peterson" wrote:

Could it be that the activesheet is protected?

Or maybe the activesheet is not a worksheet -- maybe it's a chartsheet?

If the worksheet is protected, you'll have to unprotect it.

But if it's not the correct sheet, you can tell excel which one to process:

Option Explicit
Private Sub Workbook_Open()
With Worksheets("Sheet1")
With .Cells.Font
.Name = "Arial Narrow"
.Size = 11
End With
End With
End Sub



Vick wrote:

I'm trying to have my workbooks open with a specfic font and size, however
when I open an existing workbook I get a runtime error '1004'. If I create a
new workbook from scratch I do not receive the error. Here is the code I'm
using:

Private Sub Workbook_Open()
Cells.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 11
End With
End Sub

Any Help you can give would be greatly appreciated.

Thanks!!

Vick


--

Dave Peterson


--

Dave Peterson