A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Office Excel 2003 Versions and VBA



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2005, 12:03 PM
Cameron Young
external usenet poster
 
Posts: n/a
Default Office Excel 2003 Versions and VBA

Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron
  #2  
Old June 3rd, 2005, 12:14 PM
Bob Phillips
external usenet poster
 
Posts: n/a
Default

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron



  #3  
Old June 3rd, 2005, 01:07 PM
Cameron Young
external usenet poster
 
Posts: n/a
Default

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron


"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




  #4  
Old June 3rd, 2005, 01:58 PM
Bob Phillips
external usenet poster
 
Posts: n/a
Default

You did put it in the ThisWorkbook code module, not a standard code module?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just

doesn't
seem to fire.
--
Cheers,
Cameron


"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in

message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well

with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron






  #5  
Old June 3rd, 2005, 02:48 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron





--

Dave Peterson
  #6  
Old June 4th, 2005, 11:02 AM
Cameron Young
external usenet poster
 
Posts: n/a
Default

Gents,
Thanks for your responces.
Bob:: Workbook_Open() code is in the ThisWorkbook module.
Dave:: Have already sert the macro security to low. And still nothing.
--
Cheers,
Cameron


"Dave Peterson" wrote:

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




--

Dave Peterson

  #7  
Old June 4th, 2005, 12:51 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

How do you open that workbook?

Do you open it using another macro in a different workbook?

If yes, do you use a shortcut key assigned to that macro.

If yes, does that shortcut key include the shiftkey.

If yes (again!), then remove the shiftkey from the short cut key.

===

Do you have events enabled when you try to open the workbook?


Cameron Young wrote:

Gents,
Thanks for your responces.
Bob:: Workbook_Open() code is in the ThisWorkbook module.
Dave:: Have already sert the macro security to low. And still nothing.
--
Cheers,
Cameron

"Dave Peterson" wrote:

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




--

Dave Peterson


--

Dave Peterson
  #8  
Old June 5th, 2005, 01:06 PM
Cameron Young
external usenet poster
 
Posts: n/a
Default

I open the file by either:
a) Double-clicking the file from its folder.
b) Using the Excel Recent FilecHistory list.
c) Performing a "File | Open".

--
Cheers,
Cameron


"Dave Peterson" wrote:

How do you open that workbook?

Do you open it using another macro in a different workbook?

If yes, do you use a shortcut key assigned to that macro.

If yes, does that shortcut key include the shiftkey.

If yes (again!), then remove the shiftkey from the short cut key.

===

Do you have events enabled when you try to open the workbook?


Cameron Young wrote:

Gents,
Thanks for your responces.
Bob:: Workbook_Open() code is in the ThisWorkbook module.
Dave:: Have already sert the macro security to low. And still nothing.
--
Cheers,
Cameron

"Dave Peterson" wrote:

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




--

Dave Peterson


--

Dave Peterson

  #9  
Old June 5th, 2005, 01:14 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

Do other workbooks with macros run when you open them the same way?

Cameron Young wrote:

I open the file by either:
a) Double-clicking the file from its folder.
b) Using the Excel Recent FilecHistory list.
c) Performing a "File | Open".

--
Cheers,
Cameron

"Dave Peterson" wrote:

How do you open that workbook?

Do you open it using another macro in a different workbook?

If yes, do you use a shortcut key assigned to that macro.

If yes, does that shortcut key include the shiftkey.

If yes (again!), then remove the shiftkey from the short cut key.

===

Do you have events enabled when you try to open the workbook?


Cameron Young wrote:

Gents,
Thanks for your responces.
Bob:: Workbook_Open() code is in the ThisWorkbook module.
Dave:: Have already sert the macro security to low. And still nothing.
--
Cheers,
Cameron

"Dave Peterson" wrote:

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #10  
Old June 5th, 2005, 01:28 PM
Cameron Young
external usenet poster
 
Posts: n/a
Default

Have not yet tried.
The workbook I'm having trouble with does work as expected on other users
pc's.
.........[minutes later].......
No, sadly, no other xls workbooks with Workbook_Open() events are working.
This is a problem.
--
Cheers,
Cameron


"Dave Peterson" wrote:

Do other workbooks with macros run when you open them the same way?

Cameron Young wrote:

I open the file by either:
a) Double-clicking the file from its folder.
b) Using the Excel Recent FilecHistory list.
c) Performing a "File | Open".

--
Cheers,
Cameron

"Dave Peterson" wrote:

How do you open that workbook?

Do you open it using another macro in a different workbook?

If yes, do you use a shortcut key assigned to that macro.

If yes, does that shortcut key include the shiftkey.

If yes (again!), then remove the shiftkey from the short cut key.

===

Do you have events enabled when you try to open the workbook?


Cameron Young wrote:

Gents,
Thanks for your responces.
Bob:: Workbook_Open() code is in the ThisWorkbook module.
Dave:: Have already sert the macro security to low. And still nothing.
--
Cheers,
Cameron

"Dave Peterson" wrote:

Close that workbook (if it's open)
tools|macro|security...|security level tab

Change it to medium (to be prompted each time a workbook containing macros
opens)
or
change it to low (to always allow macros to run)



Cameron Young wrote:

Hi Bob,

Actually, all of it. For some reason the Workbook_Open() event just doesn't
seem to fire.
--
Cheers,
Cameron

"Bob Phillips" wrote:

Which bit doesn't work?

--
HTH

Bob Phillips

"Cameron Young" wrote in message
...
Hi all,

Have whipped the following code in Excel/VBA and placed in the
'ThisWorkbook' module. The problem that I have is that it works well with
other users using Excel 2003 Standard edition.
I'm using Beginners edition - is that why the code won't run?

The vba code:
[-- code start --]
Private Sub Workbook_Open()

'Prompt user on opening XLS to Print Worksheet and quit.

Dim Resp

Resp = MsgBox("Do you wish to Print and Exit ?", _
vbYesNo + vbQuestion, _
"Print & Exit ?")

If Resp = vbYes Then
ActiveWorkbook.PrintOut
Application.Quit
End If

End Sub
[-- code end --]

Please help - this is driving me nuts.
--
Cheers,
Cameron




--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.