Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Vick
 
Posts: n/a
Default Problem with Workbook_open

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Problem with Workbook_open

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
  #3   Report Post  
Posted to microsoft.public.excel.misc
Vick
 
Posts: n/a
Default Problem with Workbook_open

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

  #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
  #5   Report Post  
Posted to microsoft.public.excel.misc
Vick
 
Posts: n/a
Default Problem with Workbook_open

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default Problem with Workbook_open

Is there a chance that you first explicitly activating the worksheet
will work?

Worksheets("Sheet1").Activate

HTH
Kostis Vezerides

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

You lost a dot:


Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

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

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

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

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson

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

You may want to post the complete code you're using.

Vick wrote:

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
Vick
 
Posts: n/a
Default Problem with Workbook_open

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

"Dave Peterson" wrote:

You may want to post the complete code you're using.

Vick wrote:

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson


--

Dave Peterson

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

Add the dot back.

Do you have this code in the ThisWorkbook module?

How do you know it's not doing anything?

Did you type something in that sheet to see the fontname and size?

Vick wrote:

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

"Dave Peterson" wrote:

You may want to post the complete code you're using.

Vick wrote:

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson


--

Dave Peterson


--

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

I've added the dot back, and it does not do anything. How do I know it
doesn't do anything? First off my toolbar's font and size does not change
from the default. Second I can right click on a cell, goto format cells and
the font and size are still the defaults.

The code is in This Workbook on my Personal.xls.

"Dave Peterson" wrote:

Add the dot back.

Do you have this code in the ThisWorkbook module?

How do you know it's not doing anything?

Did you type something in that sheet to see the fontname and size?

Vick wrote:

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

"Dave Peterson" wrote:

You may want to post the complete code you're using.

Vick wrote:

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

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

It worked fine for my worksheet named Sheet1.



Vick wrote:

I've added the dot back, and it does not do anything. How do I know it
doesn't do anything? First off my toolbar's font and size does not change
from the default. Second I can right click on a cell, goto format cells and
the font and size are still the defaults.

The code is in This Workbook on my Personal.xls.

"Dave Peterson" wrote:

Add the dot back.

Do you have this code in the ThisWorkbook module?

How do you know it's not doing anything?

Did you type something in that sheet to see the fontname and size?

Vick wrote:

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

"Dave Peterson" wrote:

You may want to post the complete code you're using.

Vick wrote:

Yes I know I removed the dot, when you leave the dot in absolutly nothing
happens.

"Dave Peterson" wrote:

You lost a dot:

With .Cells.Font

You may want to post the complete code you're using.

Vick wrote:

This line caused the error: With Cells.Font

Once getting the error, I goto VB and run the code again and it works. It
just does not work when I open the file.

I know the worksheet is not protected, I can send you a SS if you want.

"Dave Peterson" wrote:

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


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
have some problem with database baldamenti Excel Discussion (Misc queries) 1 October 13th 05 05:38 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"