Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Callan
 
Posts: n/a
Default I'm having problems printing on open.

Please help!

I'm using that following "very simple" code

Private_Sub Workbook_Open()
ActiveSheet.PrintOut
End Sub

Yet, Excel does not run ANY code that I put in this function, why?
I even put in a simple [MsgBox "hello", vbokonly] line just to check. But
still nothing.
Will appreciate the help.
Kind Regards,
Cal
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe it's that misplaced undersco

Private Sub Workbook_Open()

Or maybe you have the workbook_open code in the wrong module--it belongs under
the ThisWorkbook module.

Maybe you have security set to high?--change it to medium and answer yes to the
allow macros prompt.

Maybe you held down the shift key when you opened the workbook--stopping the
auto_open and workbook_open code from running.



Callan wrote:

Please help!

I'm using that following "very simple" code

Private_Sub Workbook_Open()
ActiveSheet.PrintOut
End Sub

Yet, Excel does not run ANY code that I put in this function, why?
I even put in a simple [MsgBox "hello", vbokonly] line just to check. But
still nothing.
Will appreciate the help.
Kind Regards,
Cal


--

Dave Peterson
  #3   Report Post  
Callan
 
Posts: n/a
Default

Sorry about the underscore...that's not in the code :)
But now here's where I sound like a layman. But "ThisWorkBook" Module?
I only have 1 window in VB and it only has "General" and then the rest of
the other function headings.....

Security settings are on low and I didn't hold down the shift key as I would
in Access. Please help.
Kind Regards
Cal


"Dave Peterson" wrote:

Maybe it's that misplaced undersco

Private Sub Workbook_Open()

Or maybe you have the workbook_open code in the wrong module--it belongs under
the ThisWorkbook module.

Maybe you have security set to high?--change it to medium and answer yes to the
allow macros prompt.

Maybe you held down the shift key when you opened the workbook--stopping the
auto_open and workbook_open code from running.



Callan wrote:

Please help!

I'm using that following "very simple" code

Private_Sub Workbook_Open()
ActiveSheet.PrintOut
End Sub

Yet, Excel does not run ANY code that I put in this function, why?
I even put in a simple [MsgBox "hello", vbokonly] line just to check. But
still nothing.
Will appreciate the help.
Kind Regards,
Cal


--

Dave Peterson

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Back to the VBE.
Hit ctrl-r to see the project explorer
Find your project and select it.
hit the asterisk on the numeric keypad to expand all the levels.

Under "Microsoft Excel Objects", you'll see "sheet1(sheet1)",..., ThisWorkbook

Doubleclick on ThisWorkbook and you'll see the code window.

An alternative, if you want to keep the code in that General module:

Name it Auto_open()

Sub Auto_Open()
ActiveSheet.PrintOut
End Sub

Callan wrote:

Sorry about the underscore...that's not in the code :)
But now here's where I sound like a layman. But "ThisWorkBook" Module?
I only have 1 window in VB and it only has "General" and then the rest of
the other function headings.....

Security settings are on low and I didn't hold down the shift key as I would
in Access. Please help.
Kind Regards
Cal

"Dave Peterson" wrote:

Maybe it's that misplaced undersco

Private Sub Workbook_Open()

Or maybe you have the workbook_open code in the wrong module--it belongs under
the ThisWorkbook module.

Maybe you have security set to high?--change it to medium and answer yes to the
allow macros prompt.

Maybe you held down the shift key when you opened the workbook--stopping the
auto_open and workbook_open code from running.



Callan wrote:

Please help!

I'm using that following "very simple" code

Private_Sub Workbook_Open()
ActiveSheet.PrintOut
End Sub

Yet, Excel does not run ANY code that I put in this function, why?
I even put in a simple [MsgBox "hello", vbokonly] line just to check. But
still nothing.
Will appreciate the help.
Kind Regards,
Cal


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Callan
 
Posts: n/a
Default

Thank you VERY much for the help.
I was clicking on the code for the sheet instead of right clicking on the
actual workbook and THEN code. As I've said previously......layman. It works
now.
Thanks again
Callan


"Dave Peterson" wrote:

Back to the VBE.
Hit ctrl-r to see the project explorer
Find your project and select it.
hit the asterisk on the numeric keypad to expand all the levels.

Under "Microsoft Excel Objects", you'll see "sheet1(sheet1)",..., ThisWorkbook

Doubleclick on ThisWorkbook and you'll see the code window.

An alternative, if you want to keep the code in that General module:

Name it Auto_open()

Sub Auto_Open()
ActiveSheet.PrintOut
End Sub

Callan wrote:

Sorry about the underscore...that's not in the code :)
But now here's where I sound like a layman. But "ThisWorkBook" Module?
I only have 1 window in VB and it only has "General" and then the rest of
the other function headings.....

Security settings are on low and I didn't hold down the shift key as I would
in Access. Please help.
Kind Regards
Cal

"Dave Peterson" wrote:

Maybe it's that misplaced undersco

Private Sub Workbook_Open()

Or maybe you have the workbook_open code in the wrong module--it belongs under
the ThisWorkbook module.

Maybe you have security set to high?--change it to medium and answer yes to the
allow macros prompt.

Maybe you held down the shift key when you opened the workbook--stopping the
auto_open and workbook_open code from running.



Callan wrote:

Please help!

I'm using that following "very simple" code

Private_Sub Workbook_Open()
ActiveSheet.PrintOut
End Sub

Yet, Excel does not run ANY code that I put in this function, why?
I even put in a simple [MsgBox "hello", vbokonly] line just to check. But
still nothing.
Will appreciate the help.
Kind Regards,
Cal

--

Dave Peterson


--

Dave Peterson

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
Problems printing a word document with linked excel tables. jcarlos Excel Discussion (Misc queries) 0 August 30th 05 04:01 PM
Problems Printing a Linked Word document jcarlos Excel Discussion (Misc queries) 0 August 29th 05 09:47 PM
Problems printing templates in Excel XP BPS Excel Discussion (Misc queries) 1 June 16th 05 11:18 PM
Problems when printing large workbooks Jayne Excel Discussion (Misc queries) 0 March 8th 05 03:43 PM
Excel 2003 Landscape Printing Problems Leena Excel Discussion (Misc queries) 1 February 22nd 05 12:44 PM


All times are GMT +1. The time now is 11:31 AM.

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"