LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Workbook Open not triggering

The following procedure does not trigger when I open the workbook.
I tried both as read only and NOT read only. It works great when I step
thru it (F8). It would seem to me to be a problem in the This Workbook
Module, but I don't really know what to look for.

THIS WORKBOOK
Option Explicit
Private Sub Workbook_Open()
' IF File is Read Only, Call SaveAs_Message to 'force' New File Name
' If NOT Read Only, then exit procedure

If ThisWorkbook.ReadOnly = True _
Then Call SaveAs_Message _
Else: Exit Sub
End Sub

MODULE 1
Option Explicit
Sub SaveAs_Message()
Dim Msg As String, Title As String
Dim Config As Integer, Ans As Integer
Msg = " This is a 'READ ONLY' File"
..................... blah, blah, blah,
Msg = Msg & "Selecting CANCEL will STOP this Process and CLOSE
this file "
Title = "XXXXXXX W A R N I N G ! !"
Config = vbOKCancel + vbCritical = vbButton1
Ans = MsgBox(Msg, Config, Title)
If Ans = vbOK Then Call SaveAs_Process
End Sub

Sub SaveAs_Process()
' Bring up the Save As Dialog Box
Application.Dialogs(xlDialogSaveAs).Show
End Sub

 
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
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
how do i open a data workbook when i open a timesheet workbook [email protected] uk Excel Discussion (Misc queries) 2 January 4th 09 04:50 PM
Workbook Open Event not triggering Mike Jerakis[_2_] Excel Programming 3 January 3rd 06 09:12 PM
workbooks.open without triggering event Vobiscum[_3_] Excel Programming 2 June 24th 05 07:21 AM
How do you program so that Workbook B cannot be open unless Workbook A is open? Plus I need to validation Marcello do Guzman[_3_] Excel Programming 2 December 5th 04 06:50 AM


All times are GMT +1. The time now is 06:44 AM.

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"