#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ChuckF
 
Posts: n/a
Default Macro help

I have created a macro, which in a nut shell, creates a new workbook,
and copies 3 worksheets (all in the same workbook) to the new workbook.
(See below for the macro) I am creating, saving to, and copying from
an Excel file which is on our shared network drive here at work.

When I run this macro on my computer, everything is beautiful. When I
go to someone else's computer and run it I get the following error.

Unable to set the top property of the window class. When I hit 'debug'
it is drawing attention to the 3rd line: .Top = 7
Can someone please explain why this stops here, and what I can do to
correct it, so that the macro runs on everyone's computer.

What worries me, is that the macro stops on the third line...how many
other errors (I wonder) will I find.




Sub test2()
'
' test2 Macro
' Macro recorded 4/14/2006 by Chuck Fisher
'

'
Workbooks.Add
With ActiveWindow
.Top = 7
.Left = 766
End With
With ActiveWindow
.Width = 761.25
.Height = 402
End With
ActiveWorkbook.SaveAs Filename:= _
"I:\Accounts\Active Accounts\Office Depot\Posted Monthly Margin
Report\Office Depot.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows("OD Margin Working Worksheet.xls").Activate
Columns("A:P").Select
Range("A3").Activate
Selection.Copy
Windows("Office Depot.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B24").Select
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Land"
Range("A4").Select
Sheets("Sheet2").Select
Windows("OD Margin Working Worksheet.xls").Activate
Application.CutCopyMode = False
Range("A4").Select
Sheets("lot").Select
Columns("A:P").Select
Range("A3").Activate
Selection.Copy
Windows("Office Depot.xls").Activate
ActiveSheet.Paste
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Lot"
Range("A4").Select
Windows("OD Margin Working Worksheet.xls").Activate
Application.CutCopyMode = False
Windows("Office Depot.xls").Activate
Sheets("Sheet3").Select
Windows("OD Margin Working Worksheet.xls").Activate
Sheets("Snow").Select
Columns("A:P").Select
Range("A3").Activate
Selection.Copy
Windows("Office Depot.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet3").Select
Sheets("Sheet3").Name = "Snow"
Range("A4").Select
Application.CutCopyMode = False
Sheets("Land").Select
Windows("OD Margin Working Worksheet.xls").Activate
Range("A4").Select
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ChuckF
 
Posts: n/a
Default Macro help

Nevermind...I removed the
..Top = 7
..Left = 766

and the
Width = 761.25
..Height = 402

and it works fine...sorry to waste your time.

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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


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