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: 56
Default ADO 2.7 & ADO 2.8 beforeprint

I have an excell workbook that I transfer information to access with. From
other threads, I have been told to check the Microsoft ActiveX data object
references to allow for the connection. I did this (using version 2.8). My
customer was getting errors from a hidden module so I had them search for the
latest version on their machine-2.7. I changed the references in my workbook
to 2.7 and now the macros run perfectly on there machine.

Now the problem. Since changing the version to 2.7, a macro that I use in
"This Workbook" to check for information from the user before printing does
not work. When printing, it is like the code in This Workbook is not even
there. Here's the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Header As String, Response As Integer, I As Integer
Header = Range("D2").Value
With ActiveSheet.PageSetup
.CenterHeader = "&12SI Body & Options" & Chr(10) & "APS Vehicle# " &
Header
End With
Response = MsgBox("Is this a Shop Copy or Office Copy? Click Yes for Shop
Copy, No for Office Copy, or Cancel to cancel printng", vbYesNoCancel)
If Response = vbYes Then
ActiveSheet.Unprotect ("123")
For I = 9 To 56
Range("E" & I).Select
Selection.ClearContents
Next I
Range("A1").Select
ActiveSheet.Protect ("123"), DrawingObjects:=True, Contents:=True,
Scenarios:=True, AllowFormattingCells:=True
End If

Any ideas why this is happening or what the simplest way to have this
workbook do all of the things I need?
 
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
Print preview error from BeforePrint macro LauriS Excel Discussion (Misc queries) 1 December 6th 07 12:06 AM
BeforePrint macro Steve O Excel Discussion (Misc queries) 4 September 21st 05 01:09 AM
Update header BeforePrint JCanyoneer Excel Programming 2 March 22nd 05 05:45 PM
BeforePrint event EnglishTeacher Excel Programming 4 October 13th 04 04:17 PM
Help with BeforePrint Eric[_7_] Excel Programming 2 October 9th 03 07:44 PM


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