Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Carpie
 
Posts: n/a
Default Run Time Error '1004'

A spreadsheet that is used by many different people is coming up with the
subject error now which is defined as an "Application-defined or
Object-Defined error". It gives me the chance to end or debug. When I
choose debug it takes me to code that states:

Private Sub Workbook_Open()
Sheets("Olean - Wellsville").EnableAutoFilter = True
Sheets("Olean - Wellsville").Protect contents:=True,
userInterfaceOnly:=True
End Sub

The third line is the one that it is highlighted in Yellow. I'm not versed
in VBA so I have no idea what seems to be the issue but am guessing that
somehow the syntax has been altered. Based on this limited information I
have provided, are you able to help?

I should also mention that when I open the file [Group] is appended to the
file name. I don't have any idea what that means.


  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Run Time Error '1004'

Looks like maybe a linefeed problem......try combining the two lines

Sheets("Olean - Wellsville").Protect contents:=True,
userInterfaceOnly:=True

to be all on one line,...........

Vaya con Dios,
Chuck, CABGx3


"Carpie" wrote:

A spreadsheet that is used by many different people is coming up with the
subject error now which is defined as an "Application-defined or
Object-Defined error". It gives me the chance to end or debug. When I
choose debug it takes me to code that states:

Private Sub Workbook_Open()
Sheets("Olean - Wellsville").EnableAutoFilter = True
Sheets("Olean - Wellsville").Protect contents:=True,
userInterfaceOnly:=True
End Sub

The third line is the one that it is highlighted in Yellow. I'm not versed
in VBA so I have no idea what seems to be the issue but am guessing that
somehow the syntax has been altered. Based on this limited information I
have provided, are you able to help?

I should also mention that when I open the file [Group] is appended to the
file name. I don't have any idea what that means.


  #3   Report Post  
Posted to microsoft.public.excel.misc
Carpie
 
Posts: n/a
Default Run Time Error '1004'

I think the issue is larger but am unsure how to attack it. I rem'd out
those lines to avoid them from being executed and I was able to open up the
spreadsheet fine. I thought it was fixed so sent out a notice stating such.
Unfortunately it is still bombing on the users who are using Excel97 even
though it works for me on Excel2002. It does not even provide any error
messages for them, just quits.

I made a copy of it and deleted every sheet, every macro, and every line of
code I could find. All that was left was a new blank sheet. STILL the file
just bombs when opened in Excel97 but works fine in 2002. Any ideas on how I
could troubleshoot this?

"Carpie" wrote:

A spreadsheet that is used by many different people is coming up with the
subject error now which is defined as an "Application-defined or
Object-Defined error". It gives me the chance to end or debug. When I
choose debug it takes me to code that states:

Private Sub Workbook_Open()
Sheets("Olean - Wellsville").EnableAutoFilter = True
Sheets("Olean - Wellsville").Protect contents:=True,
userInterfaceOnly:=True
End Sub

The third line is the one that it is highlighted in Yellow. I'm not versed
in VBA so I have no idea what seems to be the issue but am guessing that
somehow the syntax has been altered. Based on this limited information I
have provided, are you able to help?

I should also mention that when I open the file [Group] is appended to the
file name. I don't have any idea what that means.


  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Run Time Error '1004'

When multiple sheets are selected, you'll see [Group] in the title bar. This
means that lots of things that lots of things you do to one sheet, you do to all
the sheets in the group.

But there are somethings that can't be done when the worksheets are
grouped--including changing protection.

You can ungroup sheets manually by just rightclicking on one of the worksheets
that are grouped (notice the background color of the worksheet tabs) and
selecting Ungroup Sheets.

In code, you can select a single sheet.

Private Sub Workbook_Open()
With Sheets("Olean - Wellsville")
.select
.EnableAutoFilter = True
.Protect contents:=True, userInterfaceOnly:=True
End With
End Sub



Carpie wrote:

A spreadsheet that is used by many different people is coming up with the
subject error now which is defined as an "Application-defined or
Object-Defined error". It gives me the chance to end or debug. When I
choose debug it takes me to code that states:

Private Sub Workbook_Open()
Sheets("Olean - Wellsville").EnableAutoFilter = True
Sheets("Olean - Wellsville").Protect contents:=True,
userInterfaceOnly:=True
End Sub

The third line is the one that it is highlighted in Yellow. I'm not versed
in VBA so I have no idea what seems to be the issue but am guessing that
somehow the syntax has been altered. Based on this limited information I
have provided, are you able to help?

I should also mention that when I open the file [Group] is appended to the
file name. I don't have any idea what that means.


--

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
Hot key for time? Dave in Des Moines Excel Worksheet Functions 2 March 24th 06 04:15 PM
time sheet drop down lists Steve Excel Discussion (Misc queries) 12 March 18th 06 10:30 PM
time entry with am/pm and no colons Cyrus Excel Discussion (Misc queries) 9 March 3rd 06 11:42 AM
Entering Times Denise Excel Discussion (Misc queries) 9 November 15th 05 04:57 PM
time differences in a column 68magnolia71 Excel Worksheet Functions 3 May 9th 05 09:46 PM


All times are GMT +1. The time now is 12:44 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"