Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stoping the Link


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Stoping the Link

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stoping the Link


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stoping the Link


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stoping the Link


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
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
Stoping Excel from Calculating? John Excel Worksheet Functions 2 February 4th 10 04:27 PM
stoping auto format Shazza Excel Discussion (Misc queries) 4 June 28th 07 02:10 PM
Stoping the Macro Warning Message Jurrasicway Excel Discussion (Misc queries) 5 June 19th 06 02:56 PM
stoping excel from automatic zoomig bonus Excel Discussion (Misc queries) 1 February 10th 06 02:45 AM
Stoping IE from embedding xls sheets [email protected] Excel Discussion (Misc queries) 0 September 1st 05 09:38 PM


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