View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chrisso Chrisso is offline
external usenet poster
 
Posts: 110
Default Excel open from VBScript does not display Windows pop-up when file inuse

Hi All

I have added some VBScript in the company intranet to open an Excel
file.

The Excel file has no password.

This works fine except when someone already has the Excel file open.

In this case the user (who has clicked my intranet button and opens
the Excel file with the VBScript) does not get the normal Windows pop-
up warning that someone else is in the file. The Excel file just opens
in read-only but the user is not notified.

This will lead to problems as users will not realise and start to add
data. They will only realise when it comes to save and then they will
end up doing a "Save As" and I will end up with multiple copies.

My VBScript looks like this:

Sub OpenWorkbook(strLocation As String)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub

Has anyone else had this problem and is there a way to ensure the pop-
up occurs.

If this is the wrong forum for this question can you pleaase point me
to the correct place!

Cheers
Chrisso