Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Open Excel in New Window using a Macro

Hey guys-

I need a macro to open a file in a separate window so that I can view the
current file and the new file side by side. My current macro is opening the
file within the same window. I also need a message box that will say "Can
not file file" if the macro cannot find the file. My current macro opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually", vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Open Excel in New Window using a Macro

How about:

Option Explicit
Sub open_Wiresheet()

Dim SchedWkbk As Workbook

Set SchedWkbk = Nothing
On Error Resume Next
Set SchedWkbk = Workbooks.Open _
("O:\SEM\Common\Accounting\Mar-07 Wire Transfer Schedule.xls")
On Error Resume Next

If SchedWkbk Is Nothing Then
MsgBox prompt:="Cannot find file. Please open file manually", _
Buttons:=vbOKOnly + vbQuestion
else
'your code that arranges the windows the way you want
'something like:
Windows.Arrange ArrangeStyle:=xlVertical
End If
End Sub

And if you record a macro when you use:
Window|Arrange|vertical

You'll have the code that you need.


David T wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view the
current file and the new file side by side. My current macro is opening the
file within the same window. I also need a message box that will say "Can
not file file" if the macro cannot find the file. My current macro opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1

Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually", vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Open Excel in New Window using a Macro

Hey dave-

That's cool!!!! It worked very nicely. I'm getting a second monitor for my
computer and was wondering if it is possible to tweak this code to where it
will open this worksheet in another workbook so that I can view this
worksheet on one monitor and view the other worksheet on the other monitor.
Thanks in advance

David

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view the
current file and the new file side by side. My current macro is opening the
file within the same window. I also need a message box that will say "Can
not file file" if the macro cannot find the file. My current macro opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually", vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Open Excel in New Window using a Macro

I don't know.

I don't have two monitors so I can't test it.

But remember you can fiddle around with it manually and once you determine that
you can do it, you can record a macro to get the code.

David T wrote:

Hey dave-

That's cool!!!! It worked very nicely. I'm getting a second monitor for my
computer and was wondering if it is possible to tweak this code to where it
will open this worksheet in another workbook so that I can view this
worksheet on one monitor and view the other worksheet on the other monitor.
Thanks in advance

David

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view the
current file and the new file side by side. My current macro is opening the
file within the same window. I also need a message box that will say "Can
not file file" if the macro cannot find the file. My current macro opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually", vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Open Excel in New Window using a Macro

Hey-

Thanks for all your help. I was able to figure how how it was done by
playing around with the codes. Thanks.

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view the
current file and the new file side by side. My current macro is opening the
file within the same window. I also need a message box that will say "Can
not file file" if the macro cannot find the file. My current macro opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually", vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Open Excel in New Window using a Macro

Hi David

And for the benefit of all, what was the code you came up with?

--
Regards

Roger Govier


"David T" wrote in message
...
Hey-

Thanks for all your help. I was able to figure how how it was done by
playing around with the codes. Thanks.

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view
the
current file and the new file side by side. My current macro is
opening the
file within the same window. I also need a message box that will say
"Can
not file file" if the macro cannot find the file. My current macro
opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire
Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually",
vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Open Excel in New Window using a Macro


Roger-

I combined several codes together to get the one below. This should open up
the spreadsheet in another instance so that you can view the spreadsheets on
two separate screens.


Sub Open_Trxfer_File()

Dim objExcel As Object
Dim SchedWkbk As Workbook


On Error Resume Next
Set SchedWkbk = Nothing

Set objExcel = CreateObject("Excel.Application")


Set SchedWkbk = objExcel.Application.Workbooks.Open _
("O:\SEM\Common\Accounting\Volume Actualization - Invoice\3-
Mar 2007\Mar07 Transportation Pass Through") ' This is my personal file
objExcel.Visible = True
On Error Resume Next


If SchedWkbk Is Nothing Then
Msgbox prompt:="Cannot find file. Please open file manually", _
Buttons:=vbOKOnly + vbQuestion

End If

End Sub

"Roger Govier" wrote:

Hi David

And for the benefit of all, what was the code you came up with?

--
Regards

Roger Govier


"David T" wrote in message
...
Hey-

Thanks for all your help. I was able to figure how how it was done by
playing around with the codes. Thanks.

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can view
the
current file and the new file side by side. My current macro is
opening the
file within the same window. I also need a message box that will say
"Can
not file file" if the macro cannot find the file. My current macro
opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire
Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file manually",
vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Open Excel in New Window using a Macro

Hi David

Thank you for posting your code.
I tried it and eventually got it to work, but found it not to be as
helpful as the alternative method of stretching a file across the width
of both monitors and then using Windows Side by Side with a vertical
tiling.

I think Dave P mentioned in another thread about formulae not being able
to be copied from one session to another, and this is exactly what I
found..

--
Regards

Roger Govier


"David T" wrote in message
...

Roger-

I combined several codes together to get the one below. This should
open up
the spreadsheet in another instance so that you can view the
spreadsheets on
two separate screens.


Sub Open_Trxfer_File()

Dim objExcel As Object
Dim SchedWkbk As Workbook


On Error Resume Next
Set SchedWkbk = Nothing

Set objExcel = CreateObject("Excel.Application")


Set SchedWkbk = objExcel.Application.Workbooks.Open _
("O:\SEM\Common\Accounting\Volume Actualization -
Invoice\3-
Mar 2007\Mar07 Transportation Pass Through") ' This is my personal
file
objExcel.Visible = True
On Error Resume Next


If SchedWkbk Is Nothing Then
Msgbox prompt:="Cannot find file. Please open file manually",
_
Buttons:=vbOKOnly + vbQuestion

End If

End Sub

"Roger Govier" wrote:

Hi David

And for the benefit of all, what was the code you came up with?

--
Regards

Roger Govier


"David T" wrote in message
...
Hey-

Thanks for all your help. I was able to figure how how it was done
by
playing around with the codes. Thanks.

"David T" wrote:

Hey guys-

I need a macro to open a file in a separate window so that I can
view
the
current file and the new file side by side. My current macro is
opening the
file within the same window. I also need a message box that will
say
"Can
not file file" if the macro cannot find the file. My current
macro
opens the
message box regardless if if finds the file or not. Can someone
help???????????!!!!!!!!!!!1


Sub open_Wiresheet()
On Error GoTo Exits

Application.Workbooks.Open ("O:\SEM\Common\Accounting\Mar-07 Wire
Transfer
Schedule.xls")

Exits: reply = Msgbox("Cannot find file. Please open file
manually",
vbOK
Or vbQuestion)

If reply = vbOK Then

Exit Sub
End If
End Sub






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
Open Excel Hyperlinks in a new window Andymeadowsuk Excel Discussion (Misc queries) 0 October 30th 06 11:36 PM
excel open in new window Peter Excel Discussion (Misc queries) 4 November 10th 05 05:05 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
Excel workbook does not open in open window on desktop DeanH Excel Discussion (Misc queries) 2 March 8th 05 09:51 AM
Open Access Database under and Excel window using a Macro BMSpell Excel Worksheet Functions 1 January 8th 05 05:32 PM


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