Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a macro to open as save other selected Excel sheets

How can one create a macro that open another workbook that detects if
the workbook is allready open? Example: If I run my macro to activate
the window,but the book is not open, it shows an error. The same if I
run my macro to open the workbook, but it is allready open it shows
errors.
I would aso like to know how my macro can detect, when saving a
spesific sheet in my workbook to a new workbook ander a given file
name(ex."BACKUPSHEET.xls"), if the name in that folder allready exists
and then save it with a simular name but not the same(ex: "BACKUPSHEET
1.xls").
I would appreciate it if some one can help me with these problems.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Creating a macro to open as save other selected Excel sheets

Hi Wessie,

One way:

'=============
Public Sub Tester()
Dim wb As Workbook

On Error Resume Next
Set wb = Workbooks("YourBook.xls")
On Error GoTo 0

If wb Is Nothing Then
Workbooks.Open Filename:="YourBook.xls"
End If

End Sub
'<<=============


--
---
Regards,
Norman



"Wessie" wrote in message
oups.com...
How can one create a macro that open another workbook that detects if
the workbook is allready open? Example: If I run my macro to activate
the window,but the book is not open, it shows an error. The same if I
run my macro to open the workbook, but it is allready open it shows
errors.
I would aso like to know how my macro can detect, when saving a
spesific sheet in my workbook to a new workbook ander a given file
name(ex."BACKUPSHEET.xls"), if the name in that folder allready exists
and then save it with a simular name but not the same(ex: "BACKUPSHEET
1.xls").
I would appreciate it if some one can help me with these problems.



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
Excel Macro (open and save files with different drives) jxbeeman Excel Discussion (Misc queries) 1 September 25th 09 07:40 PM
Warning Message (at open) if Multiple Sheets are Selected Dave Excel Discussion (Misc queries) 4 October 14th 08 11:37 PM
Creating an excel macro to open and save sheets to a different directory sem Excel Programming 0 September 29th 05 07:36 PM
How do I save macro so it's there for all Excel sheets? Save a macro in Excel Excel Discussion (Misc queries) 2 September 22nd 05 08:11 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM


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