LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default WindowArrangeTiled - all xls in directory


Hi all,

This may sound kinda stupid but what i am trying to do is open all
workbooks in a directory
"One at a time" and do the "Windows.Arrange ArrangeStyle:=xlTiled" code
on them.

One issue is the workbook where the code is, obviously is open, to
start the macro.
This doesn't work because if another workbook opens then there are two
windows tiled.
I don't want that.

Another issue is the code saves and closes the workbooks, and since the
workbook with the code
is open, that won't work,

So Any Ideas?

Just in case this might somehow work, here is the code i am trying to
use.
And i apologize i don't know whose it is.


Code:
--------------------
Sub AllFolderFiles()
Dim wb As Workbook
Dim TheFile As String
Dim MyPath As String
Application.ScreenUpdating = False
Application.EnableEvents = False
'Put folder path next line.
MyPath = "C:\Documents and Settings\Owner\Desktop\Tiled Testing"
ChDir MyPath
TheFile = Dir("*.xls")
Do While TheFile < ""
Set wb = Workbooks.Open(MyPath & "\" & TheFile)
'Your code goes here.
Windows.Arrange ArrangeStyle:=xlTiled
wb.Close SaveChanges:=True
TheFile = Dir
Loop
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
--------------------


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=557636

 
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
Window Arrange Automatically Andy Excel Discussion (Misc queries) 0 October 4th 06 02:11 PM
Arrange and Tiled Duncan_J Excel Programming 0 July 1st 05 03:53 PM
undo window arrange in excel Wayne Lee Excel Discussion (Misc queries) 3 April 29th 05 12:09 AM
undo window arrange in excel Wayne Lee Excel Discussion (Misc queries) 0 April 28th 05 04:08 AM
Change directory for DOS window Garry[_4_] Excel Programming 1 January 9th 04 05:44 PM


All times are GMT +1. The time now is 01:54 PM.

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

About Us

"It's about Microsoft Excel"