OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28-02-2012, 20:39
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default X5 Constant Crashing - Macro Check please

Corel X5 is crashing when I run this macro:

Code:
Sub QuickPagePrint()

ActiveDocument.Unit = cdrMillimeter

If ActiveDocument.ActivePage.Paper = "B5 (JIS)" Then ActiveDocument.PrintSettings.SelectPrinter "EPSON LP-M5500 B5": pgo = True

If ActiveDocument.ActivePage.Paper = "B4" Then ActiveDocument.PrintSettings.SelectPrinter "EPSON LP-M5500 B4": pgo = True

If ActiveDocument.ActivePage.Paper = "A4" Then ActiveDocument.PrintSettings.SelectPrinter "EPSON LP-M5500 A4": pgo = True

If pgo = True Then

    response = MsgBox("Add Document Name?", 260, "PAGE PRINT OPTION")
                                            
    If response = vbYes Then
    
        ActivePage.CreateLayer ("TEMP")
        ActivePage.Layers("TEMP").Printable = True
        Set s = ActivePage.Layers("TEMP").CreateArtisticText(0, 0, ActiveDocument.FullFileName, _
        cdrEnglishUS, , "Eggo", 9, cdrTrue, cdrTrue, , cdrLeftAlignment)
        
        s.Fill.ApplyUniformFill CreateCMYKColor(0, 100, 100, 0)
        s.Move 10, ActivePage.SizeHeight - 9

    End If

    With ActiveDocument.PrintSettings
    
        .Copies = 1
        .PrintRange = prnCurrentPage
        If ActivePage.SizeWidth > ActivePage.SizeHeight Then .PaperOrientation = prnPaperLandscape
        
    End With
    
    ActiveDocument.PrintOut
    
    If response = vbYes Then ActivePage.Layers("TEMP").Delete
    
Else
    
    MsgBox "Problem With Page Sizes", vbExclamation, "Printing Cancelled"

End If


End Sub
If I comment out this line:
Code:
    If response = vbYes Then ActivePage.Layers("TEMP").Delete
Then it runs OK. It seems I need some kind of delay until the spooling is complete? Can anyone help me stop X5 crashing? Thanks.
Reply With Quote
  #2  
Old 28-02-2012, 22:25
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Printing

Does is actually crash or give an error message? So far I have been unable to get it to do either, everything works as expected.

-Shelby
Reply With Quote
  #3  
Old 28-02-2012, 22:35
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks for the reply, Shelby. It crashes completely - I get a Windows 7 message. Also it will crash even with the line commented out. Have you got Sp4 installed? I'm finding Coreldraw really unstable.
Reply With Quote
  #4  
Old 28-02-2012, 22:43
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Printing

I am on build 695, which I think is SP3, with Hotfix 4 installed. One thing you might try, is to turn of MultiThreading and see if that helps:

HKEY_CURRENT_USER/SOFTWARE/COREL/CORELDRAW/15.0/DRAW/APPLICATION PREFERENCES/OPTIONS-ADVANCED

You should see a key: MultiThreading, right click, select modify, and change the 1 to 0

Only if you are comfortable messing with the registry.

It should be noted, I do have MultiThreading on, and am no seeing the issue. Another recommendation would be to try a different printer / driver. It could be related.

-Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
check for modification bprice CorelDRAW/Corel DESIGNER VBA 2 27-01-2009 08:36
group check bprice CorelDRAW/Corel DESIGNER VBA 6 16-12-2008 17:30
Corel Draw 12 crashing! fordfox General 0 21-03-2007 09:46
Constant area macro or VB? Chester Macros/Add-ons 3 26-11-2006 22:10
Please someone check this! knowbodynow CorelDRAW/Corel DESIGNER VBA 9 31-03-2006 18:46


All times are GMT -5. The time now is 03:49.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com