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 17-08-2010, 17:19
PAnderson PAnderson is offline
Member
 
Join Date: Nov 2003
Posts: 47
Default Runtime Error 6 / Overflow

I created myself a macro using Alex's RecreateCurve code he posted awhile back. See this thread: http://forum.oberonplace.com/showthr...light=recreate

I created a form with 12 command buttons, each button for a different simple 60 degree shape. I.E. when you click the button it creates the shape and centers it on the page. Quite simple with Alex's code and it really saves me a lot of time!

However, occasionally I get this error when I click a button: "Runtime Error 6/Overflow." It does not happen often, and I cannot seem to replicate it consistently. It's not just a certain button either, because sometimes if I click another button and then go back to the first one that brought on the error it works fine. I am wondering what might be causing this?? Any thoughts, suggestions? If you need to see a sample .gms, let me know and I can post it later.

Patti
Reply With Quote
  #2  
Old 17-08-2010, 18:49
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
This could be happening when you are passing a value or object to a function and the value is not set.
Example: You have to have something selected in order to run the macro. Selected item also passed to function.
Make sure all of your variables are being set.

-John
Reply With Quote
  #3  
Old 17-08-2010, 20:01
PAnderson PAnderson is offline
Member
 
Join Date: Nov 2003
Posts: 47
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
This could be happening when you are passing a value or object to a function and the value is not set.
Example: You have to have something selected in order to run the macro. Selected item also passed to function.
Make sure all of your variables are being set.

-John
Nothing has to be selected. All you do is click a button and it creates the shape.

I finally was able to get the error again. When I click Debug it goes to this lines in Alex's code:

Code:
Private Function HexVal(ByVal strHex) As Long
    HexVal = Val("&h" & strHex)
End Function
I'm wondering if I need to break up some of the string codes onto separate lines with the & _ Shelby suggested. Although when it works, the shapes are created just fine. ???

Patti
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
Runtime error click101 Calendar Wizard 11 24-05-2012 13:21
Evaluate an object name at runtime fadimas CorelDRAW/Corel DESIGNER VBA 2 14-03-2007 04:52
Overflow Error on Export ddonnahoe CorelDRAW/Corel DESIGNER VBA 3 23-08-2006 07:29
Command Button at runtime Michael Cervantes Corel Photo-Paint VBA 3 22-04-2004 00:59
runtime error 445 with CorelScriptTools.GetFolder() rsinnig Corel Photo-Paint VBA 1 16-10-2003 05:07


All times are GMT -5. The time now is 18:58.


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