Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Excel open from VBScript does not display Windows pop-up when file in use

I'd suggest something like this:

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
set WB=objExcel.Workbooks.Open(strLocation)
if WB.ReadOnly Then MsgBox "File is read-only"


"Chrisso" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Excel open from VBScript does not display Windows pop-up whenfile in use

On 5 Aug, 17:55, "Jim Rech" wrote:
I'd suggest something like this:

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
set WB=objExcel.Workbooks.Open(strLocation)
if WB.ReadOnly Then MsgBox "File is read-only"

"Chrisso" wrote in message

...



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- Hide quoted text -


- Show quoted text -


Many thanks Jim. That will do nicely.

Chrisso
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
Multiple windows of single file display on windows taskbar easylife Excel Programming 2 June 3rd 09 03:29 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open email windows can't open, excel shreadsheet file .xls ? skiz Excel Discussion (Misc queries) 0 October 2nd 05 07:03 PM
how to open in windows a macintosh excel file macmai Excel Discussion (Misc queries) 6 January 8th 05 12:44 PM
Catching an Open Excel File with VBScript onedaywhen Excel Programming 2 April 6th 04 09:54 AM


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