Print Preview (2000 vs 2013)

DannyDont

New Member
Joined
Mar 7, 2014
Messages
40
I use code to perform a Print Preview. This works just fine in 2000 to 2010 (.xls). However, when this was moved to Excel 2013 (.xlsm) it no longer works as desired and in fact halts the VBA Code. I have been looking and looking for a solution but have yet to find it. Can anyone help.

Here is the code I am using.
=====
If Len(Data_File_Waycard_File_Output) > 0 Then
Windows(Data_File_Waycard_File_Output).Activate
ActiveWindow.SelectedSheets.PrintPreview
Windows("WayCardCreatorAppl" & Data_File_Waycard_Appl_Version & ".xlsm").Activate
Sheets("Welcome").Select
Else
MsgBox ("These has been no Waycard created to Preview or Print!")
End If
=====
Thanks for any help you might provide
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
How do I invoke the same Print Preview in XLSM as I do in XLS? When doing the same command structure the XLMS Version halts the code. Any ideas out there?
 
Upvote 0
Has anyone run into this issue as well and found a fix? No one has even responded in over a year! This only occurs if there is more than one page to preview.
 
Upvote 0
i've ran in to a LOT of issues with changing code from 2003 to 2010 apparently the VBA editor is now 64 bit or something like that, there was a KB article on the MS website about this.
but you do have to add a line of code for it to be "compatible"
 
Upvote 0

As the MSDN article says, use conditional compilation: it works well for me in Excel 97 through Excel 2010 32-bit & 64-bit.


<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">#If VBA7 Then
PrivateDeclare PtrSafe Sub CopyMem Lib"kernel32"Alias"RtlMoveMemory"(Destination As Any, Source As Any,ByVal Length AsLong)
#Else
PrivateDeclareSub CopyMem Lib"kernel32"Alias"RtlMoveMemory"(Destination As Any, Source As Any,ByVal Length AsLong)
#Endif</code>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,110
Messages
6,128,896
Members
449,477
Latest member
panjongshing

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top