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 07-10-2016, 06:21
noj noj is offline
Member
 
Join Date: Oct 2011
Location: Sydney
Posts: 31
Default VBA Problems since changing from X6 to X8

Hi all,
At the risk of being over simplistic, is there any reason why my code I created in CorelDRAW X6 should not work in X8?
To elaborate, I've just bought and installed X8 and I'm trying to set up my workspace and bring in some custom forms/functions/code I created and was using very successfully in X6 and before I barely began I got an error from a line of code in the GlobalMacroStorage_SelectionChange event. Why would it work in one version and not another?
Have uploaded screen shot too so that you can see the names of the forms.Name:  Code.jpg
Views: 224
Size:  93.6 KB

The error is in the line in red

Code:
Private Sub GlobalMacroStorage_SelectionChange()

    Dim col As String
    Dim colname As OptionButton
    Dim intens As Integer
    Dim siz As Integer
    Dim dia As Integer
    Dim DiamOption As OptionButton
    Dim colcode As Integer
    Dim neonNew As Label
    Dim sr As ShapeRange
    Dim neonSelected As Label
    
    Set sr = ActiveSelectionRange
    
    If ActiveDocument Is Nothing Then Exit Sub
    
    If FaceMaker.Visible = True Then
        If sr.Count <> 1 Then
            FaceMaker.ApplyB.Visible = False
        ElseIf sr(1).IsSimpleShape = Flase Then
            FaceMaker.ApplyB.Visible = False
        Else
            FaceMaker.ApplyB.Visible = True
        End If
    End If
    
    If LightsFill.Visible = True Then
        If sr.Count <> 1 Then
            LightsFill.ApplyB.Visible = False
        ElseIf sr(1).IsSimpleShape = Flase Then
            LightsFill.ApplyB.Visible = False
        Else
            LightsFill.ApplyB.Visible = True
        End If
    End If
    
    If LightsString.Visible = True Then
        If sr.Count <> 1 Then
            LightsString.applyButton1.Visible = False
        ElseIf sr(1).IsSimpleShape = Flase Then
            LightsString.applyButton1.Visible = False
        Else
            LightsString.applyButton1.Visible = True
        End If
    End If
            

    If Neon2.Visible = True Then

        If sr.Count <> 1 Then
            Set neonSelected = Neon2("neon" & Format(Neon2.Colour, "00") & "s")
            neonSelected.Visible = False
            Neon2.Selector.Visible = False
            Exit Sub
        End If
        
        If sr(1).IsSimpleShape = True Then
            Set neonSelected = Neon2("neon" & Format(Neon2.Colour, "00") & "s")
            neonSelected.Visible = False
            Neon2.Selector.Visible = False
            Exit Sub
        End If
        
        If Left(sr(1).Name, 4) <> "neon" Then
            Set neonSelected = Neon2("neon" & Format(Neon2.Colour, "00") & "s")
            neonSelected.Visible = False
            Neon2.Selector.Visible = False
            Exit Sub
        Else
            If IsNumeric(Mid(sr(1).Name, 9, 2)) = False Then
                If Mid(sr(1).Name, 9, 2) = "RU" Then sr(1).Name = Left(sr(1).Name, 8) & "01" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "RE" Then sr(1).Name = Left(sr(1).Name, 8) & "02" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "OG" Then sr(1).Name = Left(sr(1).Name, 8) & "03" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "GO" Then sr(1).Name = Left(sr(1).Name, 8) & "04" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "YE" Then sr(1).Name = Left(sr(1).Name, 8) & "05" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "GR" Then sr(1).Name = Left(sr(1).Name, 8) & "06" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "TU" Then sr(1).Name = Left(sr(1).Name, 8) & "07" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "CY" Then sr(1).Name = Left(sr(1).Name, 8) & "08" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "LI" Then sr(1).Name = Left(sr(1).Name, 8) & "09" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "BL" Then sr(1).Name = Left(sr(1).Name, 8) & "10" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "DE" Then sr(1).Name = Left(sr(1).Name, 8) & "11" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "PU" Then sr(1).Name = Left(sr(1).Name, 8) & "12" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "MA" Then sr(1).Name = Left(sr(1).Name, 8) & "13" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "HO" Then sr(1).Name = Left(sr(1).Name, 8) & "14" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "WH" Then sr(1).Name = Left(sr(1).Name, 8) & "15" & Mid(sr(1).Name, 11, 8)
                If Mid(sr(1).Name, 9, 2) = "WA" Then sr(1).Name = Left(sr(1).Name, 8) & "16" & Mid(sr(1).Name, 11, 8)
            End If
            Set neonSelected = Neon2("neon" & Format(Neon2.Colour, "00") & "s")
            neonSelected.Visible = False
            Neon2.Selector.Visible = False
            colcode = Mid(sr(1).Name, 9, 2)
            Set neonNew = Neon2("neon" & Mid(sr(1).Name, 9, 2) & "s")
            neonNew.Visible = True
            Neon2.Selector.Visible = True
            Neon2.Selector.Top = 12 + ((colcode - 1) * 15)
            Set DiamOption = Neon2("Diam" & Format(Mid(sr(1).Name, 17, 2), "00"))
            intens = Mid(sr(1).Name, 11, 3)
            siz = Mid(sr(1).Name, 14, 3)
            dia = Mid(sr(1).Name, 17, 2)
            Neon2.ChangeTest = "Update"
            Neon2.Colour = Format(colcode, "00")
            Neon2.Diam = dia
            DiamOption.Value = True
            Neon2.GlowIntensitySlider = intens
            If intens = 0 Then
                Neon2.GlowIntensity = "No Glow"
            Else
                Neon2.GlowIntensity = intens & "%"
            End If
            Neon2.GlowSizeSlider = siz
            Neon2.GlowSize = siz & "mm"
            BringWindowToTop AppWindow.Handle
        End If
    End If
    
End Sub

Last edited by noj; 07-10-2016 at 06:26.
Reply With Quote
  #2  
Old 08-10-2016, 13:24
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 X8 Error

What is the error message you are getting?

-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
Changing Palettes nic CorelDRAW/Corel DESIGNER VBA 3 19-08-2010 19:16
Changing Workspace through VBA vindaa CorelDRAW/Corel DESIGNER VBA 0 30-03-2008 17:32
Changing fontname Sebastian CorelDRAW/Corel DESIGNER VBA 30 26-07-2007 11:00
Changing Outline width knowbodynow CorelDRAW/Corel DESIGNER VBA 3 12-03-2007 11:23
changing Caption bumblebee CorelDRAW/Corel DESIGNER VBA 6 13-12-2004 09:13


All times are GMT -5. The time now is 14:40.


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