Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a spreadsheet that when i press a button it opens another spreadsheet copies some of the data and pastes it into the original book. This works fine but i have two issues. Firstly if the workbook is already open by another user it will ask if i would like to read only. Is there anyway to auto set it to read only if the book is already open by someone else? The second book when auto being closed asks the user whether they would lke to save the workbook. I would like to stop this so the process works in a smooth way without any intervention from the operator. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=398762 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Application.DisplayAlerts = False 'open worksheet 'copy data 'close worksheet Application.DisplayAlerts = True As long as you do not have to make any changes ot the worksheet that you are copying from, this will work fine. Application.DisplayAlerts = False turns off the warning messages Application.DisplayAlerts = True turns them back on "ceemo" wrote: I have a spreadsheet that when i press a button it opens another spreadsheet copies some of the data and pastes it into the original book. This works fine but i have two issues. Firstly if the workbook is already open by another user it will ask if i would like to read only. Is there anyway to auto set it to read only if the book is already open by someone else? The second book when auto being closed asks the user whether they would lke to save the workbook. I would like to stop this so the process works in a smooth way without any intervention from the operator. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=398762 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That great many thanks Can anyone help me with the first part of my problem ?? -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=398762 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() about your first problem... if you open a file already opened for editing by another user, the file automatically becomes read-only for you (right?). so you don't have to set it to read-only.... but then, you can still edit the file and save it as a different copy (right?).... if what you want is to really lock the workbook and its sheet(s) from being modified, maybe you can protect it. you'll have to determine if the workbook has been opened by a different user, then protect it. Private Sub Workbook_Open() 'check if file is already opened 'wouldn't know how to appropriately do this 'only way i can think of is to check MyWorkbook.ReadOnly if MyWorkbook.ReadOnly then 'protect book and sheets else 'unprotect... end if End Sub of course, i'm assuming this is what you mean by your problem... ![]() ceemo Wrote: That great many thanks Can anyone help me with the first part of my problem ?? -- T-®ex ------------------------------------------------------------------------ T-®ex's Profile: http://www.excelforum.com/member.php...o&userid=26572 View this thread: http://www.excelforum.com/showthread...hreadid=398762 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks the the reply. I think im fine wih the second now. With regards to the first it wont really become read only automaticall because it we will the user. If the uer sys no the workbook closes. want to take away the pop up option and automatically put the user int the workbook as read onl -- ceem ----------------------------------------------------------------------- ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065 View this thread: http://www.excelforum.com/showthread.php?threadid=39876 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stoping Excel from Calculating? | Excel Worksheet Functions | |||
stoping auto format | Excel Discussion (Misc queries) | |||
Stoping the Macro Warning Message | Excel Discussion (Misc queries) | |||
stoping excel from automatic zoomig | Excel Discussion (Misc queries) | |||
Stoping IE from embedding xls sheets | Excel Discussion (Misc queries) |