Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple windows of single file display on windows taskbar | Excel Programming | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
Open email windows can't open, excel shreadsheet file .xls ? | Excel Discussion (Misc queries) | |||
how to open in windows a macintosh excel file | Excel Discussion (Misc queries) | |||
Catching an Open Excel File with VBScript | Excel Programming |