connecting users of the CorelDRAW family of products

VBA long standing crash problem needs fixed. Please pass to Alex.

rated by 0 users
Not Answered This post has 0 verified answers | 16 Replies | 1 Follower

Share  
Page 1 of 2 (17 items) 1 2 Next > | RSS

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com
Sub GDG_John( ) posted on Fri, Jun 22 2012 17:20

Hi.

This has been around for a long time. I posted a long time ago on Oberon Place but it's still there.

This causes crash in all versions.It's still here in X6.

Sub test()
    Dim s As Shape, sr As New ShapeRange
    sr.Add s
End Sub

 

Yes I know s should not be nothing but sometimes when testing code you might lose your object or it doesn't even get set for reason of other errors from either program glitches or user coding error. This will cause unnecessary  program crashes when one is testing/debugging code. Please fix so it doesn't crash.

It's more stable similar function AddRange can take anything without causing the program to crash.

~John

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

All Replies

Top 50 Contributor
Ottawa, Canada
Male

I've submitted a bug report for you.  Unfortunately, we will not be able to fix it for SP1.

Regards,

Hendrik

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com

Hendrik Wagenaar:

I've submitted a bug report for you.  Unfortunately, we will not be able to fix it for SP1.

Regards,

Hendrik

Thank you!.

~John

 

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

Top 50 Contributor
Germany / Europe
Male
CorelDRAWMaster
mo replied on Mon, Jun 25 2012 18:31

RunFlaCruiser:
Yes I know s should not be nothing but sometimes when testing code you might lose your object or it doesn't even get set for reason of other errors from either program glitches or user coding error

This caused me headaches for weeks! Simply to know that Corel crashes on THIS gets me sleeping much better now... Thanks John!

„We are SATISFIED if we got everything we wished to have. But we can only be HAPPY if our EGO hadn‘t been standing in our way to get there.“

Sustainable Graphics Design & Illustration: econceptum.com

Blog: mobeumers.wordpress.com

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com

Hi.

Yea Mo. I think this one gave everyone a headache at least once.Tongue TiedBig Smile

~John

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

Top 200 Contributor
Bella Vista, Arkansas USA
Male

Caused me some headaches too, so I do things like this...

If Not s Is Nothing then sr.Add s

 ...or more often than not I send it to an error handler to help with debugging or a prevent a crash.

Top 50 Contributor
Germany / Europe
Male
CorelDRAWMaster
mo replied on Thu, Jun 28 2012 12:01

Steve:
If Not s Is Nothing then sr.Add s

In cases where I had to loop through a dynamic ShapeRange, even "Not s Is Nothing" didn't work for me. When I had Shapes deleted from a ShapeRange during runtime,  the Locals window in the VBA editor was constantly saying "The referenced Shape doesn't exist anymore", so I used

If Not s Is Empty Then ...

I assume a shape is passed by reference in a ShapeRange, so it was better to check if the referenced object (the deleted Shape) is empty rather than nothing, cause the reference pointer was still there, but no object to fill it. Maybe this can help anyone in the future.

„We are SATISFIED if we got everything we wished to have. But we can only be HAPPY if our EGO hadn‘t been standing in our way to get there.“

Sustainable Graphics Design & Illustration: econceptum.com

Blog: mobeumers.wordpress.com

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com

mo:
In cases where I had to loop through a dynamic ShapeRange, even "Not s Is Nothing" didn't work for me. When I had Shapes deleted from a ShapeRange during runtime,  the Locals window in the VBA editor was constantly saying "The referenced Shape doesn't exist anymore", so I used

Hi.

Me too. I think I recall this not working all the time.

mo:
If Not s Is Empty Then ...

Cool. Never tried that.

~John

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

Top 200 Contributor
Bella Vista, Arkansas USA
Male

mo:

If Not s Is Empty Then ...

 

Haven't tried that one either, so will give it a shot. Thanks!

Top 50 Contributor
Germany / Europe
Male
CorelDRAWMaster
mo replied on Thu, Jun 28 2012 18:52

RunFlaCruiser:
I think I recall this not working all the time.

I would not suggest to recall it. VBA should not crash on this anyway. At least logically:

It is like giving a bag (the variable) of cookies (the internal object) to my girlfriend (the procedure or function). She doesn't have the right to separate from me (the crash), if the cookie bag is empty. A slap (an error message) would do it.Big SmileBig Smile

„We are SATISFIED if we got everything we wished to have. But we can only be HAPPY if our EGO hadn‘t been standing in our way to get there.“

Sustainable Graphics Design & Illustration: econceptum.com

Blog: mobeumers.wordpress.com

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com

HI Mo.

Can I have some of that beer too!

lol.

~John

 

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

Top 50 Contributor
Germany / Europe
Male
CorelDRAWMaster
mo replied on Thu, Jun 28 2012 19:40

ROFL

German beer is quite good, but not for the purpose I think you ascribe to me...Yes

CheersBeer

„We are SATISFIED if we got everything we wished to have. But we can only be HAPPY if our EGO hadn‘t been standing in our way to get there.“

Sustainable Graphics Design & Illustration: econceptum.com

Blog: mobeumers.wordpress.com

Top 10 Contributor
Pigeon Forge, TN
Male
TAG - gdgmacros.com

Hi.

I bet it is, and strong. Probably better than my Natural Lite as long as it's not warm beer.

My wife got me a 6 pack of Dos Equis for my birthday. Good stuff!

Cheers Beer

~John

Visit me at my GDGMacros website anytime!

Join me on Facebook to stay up to date with GDGMacros, Tips and Tricks for VBA Automation in CorelDraw, Discounts, specials, Free code and macros, and more cool sometimes not so relevant posts!

Top 200 Contributor
Bella Vista, Arkansas USA
Male

mo:
German beer is quite good...

I was fortunate enough to visit Germany a few years back. Was with some guys that walked up to a stand outside of a bar where a waitress quickly walked up with a wooden case full of glasses of brew. Had a good time that night. They do it a bit different here in the US.

Top 50 Contributor
Germany / Europe
Male
CorelDRAWMaster
mo replied on Sat, Jun 30 2012 15:59

LOL, I'm sure they do it a bit different in the US, but that thing with the wooden case is nothing we germans are used to get if we order a beer, honestly. It's called "beer meter", and it's a gag, mostly in discotheques or open air pubs. There's also a "beer tower" available in some discotheques, a plexiglass tube with a beer tab below. I can imagine there are some similar inventions in some places in the US too. Would be hard for me to believe the germans are the only 'creative' people when it comes to get royally drunk...Big Smile

„We are SATISFIED if we got everything we wished to have. But we can only be HAPPY if our EGO hadn‘t been standing in our way to get there.“

Sustainable Graphics Design & Illustration: econceptum.com

Blog: mobeumers.wordpress.com

Page 1 of 2 (17 items) 1 2 Next > | RSS
© Corel Corporation. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms and Conditions / User Guidelines.