Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 1004 runtime error

Hi...

I saved an Excel Application as Microsoft Excel Complement and when i
started the Application, the followin was prompt:

1004 runtime error
Error in 'Worksheets' method of '_Global' Object

Here is the code causing the error

Sub Auto_open()


'Modificacion de la GUI de Excel
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''

Application.DisplayStatusBar = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.DisplayFormulaBar = False


For i = 1 To Int(Worksheets.Count) 'This line is causing the error

Worksheets(i).Activate
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With

Next i

Sheets(1).Select
Range("A44").Select
ActiveWindow.ScrollRow = 1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 1004 runtime error


Try giving explicit reference of the Workbook to the Worksheets
collection

Something like: Workbooks("1").Worksheets.Count or
Thisworkbook.Worksheets.Count


--
a7n9


------------------------------------------------------------------------
a7n9's Profile: http://www.excelforum.com/member.php...o&userid=32149
View this thread: http://www.excelforum.com/showthread...hreadid=562551

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
runtime error 1004 HELP PLS Marcelo P Excel Discussion (Misc queries) 2 May 23rd 07 08:56 PM
Runtime Error 1004 Lizz45ie[_10_] Excel Programming 4 November 8th 05 10:51 PM
Runtime Error '1004' [email protected] Excel Discussion (Misc queries) 2 July 18th 05 06:10 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Runtime error '1004' Dkso Excel Programming 3 January 10th 05 03:54 PM


All times are GMT +1. The time now is 04:58 PM.

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"