Issues running external macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
zabolyx
Posts: 216
Joined: Fri Aug 07, 2009 7:28 pm

Issues running external macro

Post by zabolyx »

I'm working on a macro (Macro A) that loads a file (spreadsheet) and runs a macro saved within that sheet (Macro B) that copies the data from the first spreadsheet into the new spreadsheet.

I'm having an issue trying to call other macros from within Macro B.

Since Spreadsheet 1 and 2 are just different versions of the same thing I'm wondering if it could be an issue with the macro names. I'm trying to load the progress dialog and the macro that sets it up with the standard call being used.

When I do this I get an error of the variable is not defined when I try to set the progress dialog's labels or values of the progress bar.

What can I do to allow this macro to call other routines within the same document? Could it be a naming issue and I should see about setting up the progress dialog from scratch in Spreadsheet 2?
OOo 3.1 On Windows XP SP3 (Home)
Running portables of 2.4, 3.0, 3.1, and 3.2 on XP SP3 (Work)
OOo BASIC user

My contribution to the OOo Community code and more
https://sites.google.com/site/ooomacrolog/
zabolyx
Posts: 216
Joined: Fri Aug 07, 2009 7:28 pm

Re: Issues running external macro

Post by zabolyx »

I have tried taking the code from the macro I'm trying to call within Spreadsheet 2 and place it directly within the calling macro. I'm also having errors with this approach.

Could it be because I'm using this code to get the Progress Dialog objects setup for use.

This is the code I'm trying to load whether called or within the same routine.... gives me an error on the first label I try to get with get control statement.

Code: Select all

'stores the dialog objects
Global oProgressDialog as Object
Global oProgressLabel1 as Object
Global oProgressLabel2 as Object
Global oProgressBar1 as Object
Global oProgressBar2 as Object

Sub mProgressSetup
	
	'this sub preps the progress dialog for use
	
	'call the library that controls the dialogs
	DialogLibraries.LoadLibrary("Standard")
	
	'Create the dialog UNO Object
	oProgressDialog = CreateUNODialog(DialogLibraries.Standard.DialogProgress)
	
	'setup the labels on the dialog
	oProgressLabel1 = oProgressDialog.getControl("PRG-Label1")
	oProgressLabel2 = oProgressDialog.getControl("PRG-Label2")
	
	'setup the progress bars
	oProgressBar1 = oProgressDialog.getControl("PRG-Progress1")
	oProgressBar2 = oProgressDialog.getControl("PRG-Progress2")
	
	'reset the labels on the dialog
	oProgressLabel1.Text = ""
	oProgressLabel2.Text = ""
	
	'reset the progressbars
	oProgressBar1.Value = 0
	oProgressBar2.Value = 0
	
	'show the dialog
	oProgressDialog.setVisible(True)
		
End Sub
When setting this up for running within the same routine that I was trying to call it from I change the Globals to DIm and include it within the routine itself. Like so...

Code: Select all

    'stores the dialog objects
    Dim oProgressDialog as Object
    Dim oProgressLabel1 as Object
    Dim oProgressLabel2 as Object
    Dim oProgressBar1 as Object
    Dim oProgressBar2 as Object

    'call the library that controls the dialogs
    DialogLibraries.LoadLibrary("Standard")
    
    'Create the dialog UNO Object
    oProgressDialog = CreateUNODialog(DialogLibraries.Standard.DialogProgress)
    
    'setup the labels on the dialog
    oProgressLabel1 = oProgressDialog.getControl("PRG-Label1")
    oProgressLabel2 = oProgressDialog.getControl("PRG-Label2")
    
    'setup the progress bars
    oProgressBar1 = oProgressDialog.getControl("PRG-Progress1")
    oProgressBar2 = oProgressDialog.getControl("PRG-Progress2")
    
    'reset the labels on the dialog
    oProgressLabel1.Text = ""
    oProgressLabel2.Text = ""
    
    'reset the progressbars
    oProgressBar1.Value = 0
    oProgressBar2.Value = 0
Then I show the dialog later in the routine. Both methods error out at oProgressLabel1 = oProgressDialog.getControl("PRG-Label1") with a variable not defined.

Now this code is known to work when called by other macros, subs or whatever in my program. The only time I get this error is when Spreadsheet 1 calls a routine from Spreadsheet 2 and this code is part of Spreadsheet 2's code.

Spreadsheet 1 uses this code to call the sub in Spreadsheet 2.

Code: Select all

	'setup the macro provider from the new version
	oScriptProvider = oNewVersionDoc.getScriptProvider() '============oNewVersionDoc is Spreadsheet 2 opened in the previous lines
  
	'assign the correct macro from the new version
	oScript = oScriptProvider.getScript("vnd.sun.star.script:Standard.Upgrade.mUpgradeGetOldData?language=Basic&location=document")
	
	'run the macro with data passed to it
	oScript.invoke(Array(ThisComponent), Array(), Array())

And here is the full code (most likely not very pretty) that I'm trying to run at the moment. The first routine is what is ran by Spreadsheet 1 and then the second routine is the one ran within Spreadsheet 2. All of the code is included in both Spreadsheets as Spreadsheet 2 is just a newer version of the Spreadsheet 1. This is to be my upgrade engine for the program. When a new version of the Spreadsheet is available the program downloads the new version form the FTP server and then runs the upgrade macro from the new sheet which uses data in a table to tell it where to copy and paste the data (which allows for me to make changes to the layout of the sheets and data because I can change where it gets placed in the table). Then it will save itself to the same directory as the older version and save the older version as a backup file (.bak) and then close the old version of the spreadsheet so that the user can work with the new one.

Code: Select all

REM  *****  BASIC  *****

'store the old sheet objects
Global oOldVersionDoc as Object
Global oOldVersionSheet as Object

'store the new sheet objects
Global oNewVersionDoc as Object
Global oNewVersionSheet as Object







Sub mUpgradeDownloadNewVersion(sNewVersionName as String)
    
    'close the RCF File
    oRCFDoc.Close(True)

    'store the location of the new file
    Dim sNewVersionLink as String
    
    'stores the parts of the FTP server link
    Dim sFTPUserName as String
    Dim sFTPPassword as String
    Dim sFTPAddress as String
    Dim sFTPPath as String
    Dim sFTPLink as String
        
    'get the FTP data from the internal settings sheet
    sFTPUserName = oInternalSettingsSheet.getCellRangeByName("AK56").String
    sFTPPassword = oInternalSettingsSheet.getCellRangeByName("AK57").String
    sFTPAddress = oInternalSettingsSheet.getCellRangeByName("AK55").String
    sFTPPath = oInternalSettingsSheet.getCellRangeByName("AK60").String
    
    'create the link to the new version
    sNewVersionLink = ConvertToURL("ftp://" & sFTPUserName & ":" & sFTPPassword & "@" & sFTPAddress & sFTPPath & sNewVersionName)
    
    'stores the options for opening the new version
    Dim oNewVersionOptions(0) as New com.sun.star.beans.PropertyValue

'    oNewVersionsOptions(0).Name = "Hidden"
'    oNewVersionsOptions(0).Value = False

    oNewVersionOptions(0).Name = "MacroExecutionMode"
    oNewVersionOptions(0).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
        
    'open the new file
    oNewVersionDoc = starDesktop.loadComponentFromURL(sNewVersionLink, "_blank", 0, oNewVersionOptions())
    
    'set the new version sheet object
    oNewVersionSheet = oNewVersionDoc.getSheets()

    'store the name of the new version file
    Dim sNewVersionTitle as String

    'title of new version file
    sNewVersionTitle = oNewVersionDoc.Title
    
    'setup the macro provider from the new version
    oScriptProvider = oNewVersionDoc.getScriptProvider()
  
    'assign the correct macro from the new version
    oScript = oScriptProvider.getScript("vnd.sun.star.script:Standard.Upgrade.mUpgradeGetOldData?language=Basic&location=document")
    
    'run the macro with data passed to it
    oScript.invoke(Array(ThisComponent), Array(), Array())


    'stores the save options of the old file
    Dim oOldSaveOptions(0) as New com.sun.star.beans.PropertyValue
    
    'stores the formatted file name
    Dim sFileName as String
    Dim sPathName as String
    
    'get the name of the current document
    sFileName = oDoc.Title
    
    'add the backup name to the file
    sFileName = Left(sFileName,Len(sFileName) - 4) & ".bak"
    
    'get the current path and file name for the old version    doc
    sPathName = oDoc.URL
    
    'remove the file:/// from the file name
    sPathName = Right(sPathName, Len(sPathName) - 8)

    'store the last character of the path
    Dim sLastChar as String
    sLastChar = ""
    
    'process the path name until the file name is removed
    Do Until sLastChar = "/"
        
        'read the last character of the path
        sLastChar = Right(sPathName,1)
        
        'if the last character is not a directory name then delete the last character
        If sLastChar <> "/" Then sPathName = Left(sPathName,Len(sPathName)-1)
    
    'keep looping until done
    Loop

    'store the location of the found %20
    Dim iFound20 as Integer

    'get the first %20's location
    iFound20 = InStr(sPathName,"%20")
    
    'process the path name until all of the %20's are removed
    Do Until iFound20 = 0

        'remove the found %20 from the path name
        Mid(sPathName, iFound20, 3, " ")
        
        'get the next location
        iFound20 = InStr(sPathName,"%20")

    'keeep looping until done        
    Loop
    
    'set the path including the file name
    sPathName = ConvertToURL(sPathName & "Backup/" & sFileName)
    
    'save the file to the selected location with the user's name and date
    oDoc.storeAsURL(sPathName,oOldSaveOptions())

    'close the old version needs to go here
    oDoc.Close(True)
            
End Sub





Sub mUpgradeGetOldData(oOldVersionDoc as Object)
    
    'stores the dialog objects
    Dim oProgressDialog as Object
    Dim oProgressLabel1 as Object
    Dim oProgressLabel2 as Object
    Dim oProgressBar1 as Object
    Dim oProgressBar2 as Object

    'call the library that controls the dialogs
    DialogLibraries.LoadLibrary("Standard")
    
    'Create the dialog UNO Object
    oProgressDialog = CreateUNODialog(DialogLibraries.Standard.DialogProgress)
    
    'setup the labels on the dialog
    oProgressLabel1 = oProgressDialog.getControl("PRG-Label1")
    oProgressLabel2 = oProgressDialog.getControl("PRG-Label2")
    
    'setup the progress bars
    oProgressBar1 = oProgressDialog.getControl("PRG-Progress1")
    oProgressBar2 = oProgressDialog.getControl("PRG-Progress2")
    
    'reset the labels on the dialog
    oProgressLabel1.Text = ""
    oProgressLabel2.Text = ""
    
    'reset the progressbars
    oProgressBar1.Value = 0
    oProgressBar2.Value = 0
    
    'store the data of the old version file
    Dim oOldVersionSheet as Object
    
    'store the data of the new version file
    Dim oNewVersionSheet as Object
    Dim oNewVersionDoc as Object
    
    'setup the old sheet
    oOldVersionSheet = oOldVersionDoc.Sheets()
    
    'setup the new file and sheet
    oNewVersionDoc = ThisComponent
    oNewVersionSheet = oNewVersionDoc.Sheets()
    
    'stores the old version of the software
    Dim sOldVersion as String
    
    sOldVersion = oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("W55").String & "." & oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("W56").String & ".x"
    
    'store the columns that the version data is in
    Dim sUpgradeLocations(4, 5) as String
    
    'setup the current version
    sUpgradeLocations(0, 1) = "N"
    sUpgradeLocations(0, 2) = "V"
    sUpgradeLocations(0, 3) = "Y"
    sUpgradeLocations(0, 4) = "AB"
    sUpgradeLocations(0, 5) = "AE"

    'setup the next version
    sUpgradeLocations(1, 1) = "AH"
    sUpgradeLocations(1, 2) = "AP"
    sUpgradeLocations(1, 3) = "AS"
    sUpgradeLocations(1, 4) = "AV"
    sUpgradeLocations(1, 5) = "AY"

    'setup the next version
    sUpgradeLocations(2, 1) = "BB"
    sUpgradeLocations(2, 2) = "BJ"
    sUpgradeLocations(2, 3) = "BM"
    sUpgradeLocations(2, 4) = "BP"
    sUpgradeLocations(2, 5) = "BS"

    'setup the next version
    sUpgradeLocations(3, 1) = "BV"
    sUpgradeLocations(3, 2) = "CD"
    sUpgradeLocations(3, 3) = "CG"
    sUpgradeLocations(3, 4) = "CJ"
    sUpgradeLocations(3, 5) = "CM"

    'setup the next version
    sUpgradeLocations(4, 1) = "CP"
    sUpgradeLocations(4, 2) = "CX"
    sUpgradeLocations(4, 3) = "DA"
    sUpgradeLocations(4, 4) = "DD"
    sUpgradeLocations(4, 5) = "DG"
    
    'store the found version number location to use
    Dim iFoundVersion as Integer
    iFoundVersion = 0
        
    'count through the upgrade versions to check
    For iColCounter1 = 1 to 4
        
        'check if the versions match
        If sOldVersion = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iColCounter1,1) & 3).String Then iFoundVersion = iColCounter1
        
    'next version to test
    Next iColCounter1
    
    'store the number items to copy
    Dim iDataSetsCount as Integer
    iDataSetsCount = 0
    
    'count through the rows of data to import
    For iRowCounter1 = 5 to 1004
        
        'check if there is data to get
        If oNewVersionSheet.getByName("Upgrader").getCellRangeByName("B" & iRowCounter1).String <> "" Then iDataSetsCount = iDataSetsCount + 1
                
    'next row to test for data
    Next iRowCounter1
    
    'store the password for locking and unlocking the sheets and document
    Dim sNewPassword as String
    
    'get the password from the new document
    sNewPassword = oNewVersionSheet.getByName("Internal Settings").getCellRangeByName("I55").String

    'store the password for locking and unlocking the sheets and document
    Dim sOldPassword as String
    
    'get the password from the new document
    sOldPassword = oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("I55").String
    
    'store the range and sheet data from the row read
    Dim sPasteSheet as String
    Dim sCopySheet as String
    Dim sTempCol1 as String
    Dim sTempCol2 as String
    Dim sTempRow1 as String
    Dim sTempRow2 as String
    Dim sTempRange as String

    'show the dialog
    oProgressDialog.setVisible(True)
    
    'set the seconday label on the progress dialog    
    oProgressLabel1.Text = "Copying data from old to new"

    'set the secondary progressbar
    oProgressBar1.Value = 0
    oProgressBar2.Value = 0

    'store the data found flag
    Dim bDataFoundFlag as Boolean
    
    'store the number of rows in the test array
    Dim iTestRows as Integer
    
    'count through the data sets to copy
    For iRowCounter1 = 5 to iDataSetsCount + 4

        'clear the range data
        sPasteSheet = ""
        sCopySheet = ""
        sTempCol1 = ""
        sTempCol2 = ""
        sTempRow1 = ""
        sTempRow2 = ""
        
        'get the old versions sheets range data
        sCopySheet = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 1) & iRowCounter1).String
        sTempCol1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 2) & iRowCounter1).String
        sTempCol2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 3) & iRowCounter1).String
        sTempRow1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 4) & iRowCounter1).String
        sTempRow2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 5) & iRowCounter1).String

        'check if the data is row, block or column based and concatenate 
        '    the data as needed
        If sTempCol2 <> "" AND sTempRow2 <> "" Then
            
            'build the range as it is a block
            sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow2
            
        'check if it is a column range
        ElseIf sTempCol2 = "" AND sTempRow2 <> "" Then
        
            'build the range as it is a column
            sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol1 & sTempRow2
        
        'check if it is a row range
        ElseIf sTempCol2 <> "" AND sTempRow2 = "" Then
        
            'build the range as it is a row
            sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow1

        'check if it is a row range
        ElseIf sTempCol2 = "" AND sTempRow2 = "" Then
        
            'build the range as it is a row
            sCopyRange = sTempCol1 & sTempRow1
        
        'end the current if statment
        End If
        
        'dump the selected range into an array
        aTestArray = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange).DataArray
        
        'get the number of rows to test in the array
        iTestRows = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange).Rows.Count
        
        'reset the data found flag
        bDataFoundFlag = False
        
        'reset the temp counter
        iTempCounter1 = 0
        
        'count through the array to test array for data
        Do While iTempCounter1 <> iTestRows
                    
            'test the current element for data
            If aTestArray(iTempCounter1)(0) <> "" Then
                
                'set the data found flag
                bDataFoundFlag = True
                
                'exit the current loop
                Exit Do
            
            'end the current if statement
            End If
                        
            'increment the counter
            iTempCounter1 = iTempCounter1 + 1
            
        'test the next element
        Loop

        'test if the array had any data found
        If bDataFoundFlag = True Then

            'clear the range data
            sPasteSheet = ""
            sTempCol1 = ""
            sTempCol2 = ""
            sTempRow1 = ""
            sTempRow2 = ""

            'get the current sheets range data
            sPasteSheet = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 1) & iRowCounter1).String
            sTempCol1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 2) & iRowCounter1).String
            sTempCol2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 3) & iRowCounter1).String
            sTempRow1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 4) & iRowCounter1).String
            sTempRow2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 5) & iRowCounter1).String
                    
            'check if the data is row, block or column based and concatenate 
            '    the data as needed
            If sTempCol2 <> "" AND sTempRow2 <> "" Then
                
                'build the range as it is a block
                sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow2
                
            'check if it is a column range
            ElseIf sTempCol2 = "" AND sTempRow2 <> "" Then
            
                'build the range as it is a column
                sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol1 & sTempRow2
            
            'check if it is a row range
            ElseIf sTempCol2 <> "" AND sTempRow2 = "" Then
            
                'build the range as it is a row
                sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow1
    
            'check if it is a row range
            ElseIf sTempCol2 = "" AND sTempRow2 = "" Then
            
                'build the range as it is a row
                sPasteRange = sTempCol1 & sTempRow1
            
            'end the current if statment
            End If        
                    
            'store the copy object
            Dim oCopy as Object
            Dim oPaste as Object
    
            'unlock the sheets
            oNewVersionSheet.getByName(sPasteSheet).Unprotect(sNewPassword)
            oOldVersionSheet.getByName(sCopySheet).Unprotect(sOldPassword)
                    
            'setup the copy and paste objects
            oCopy = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange)
            oPaste = oNewVersionSheet.getByName(sPasteSheet).getCellRangeByName(sPasteRange)
            
            'copy the data from the old document to the new document
            oPaste.DataArray = oCopy.DataArray
            
            'lock the sheets
            oNewVersionSheet.getByName(sPasteSheet).Protect(sNewPassword)
            oOldVersionSheet.getByName(sCopySheet).Protect(sOldPassword)
            
        'end the current if statement
        End If
        
        
        'set the seconday label on the progress dialog    
        oProgressLabel2.Text = sCopySheet & " - " & sCopyRange
    
        'set the secondary progressbar
        oProgressBar1.Value = (iRowCounter1 / iDataSetsCount) * 100
        oProgressBar2.Value = (iRowCounter1 / iDataSetsCount) * 100
        

        
    'next row to get the stuff to copy
    Next iRowCounter1


    
'==============================================
'==============================================
'=============configure columns and metros here
'==============================================
'==============================================




'    'setup the macro provider from the new version
'    oScriptProvider = oNewVersionDoc.getScriptProvider()
' 
'    'assign the correct macro from the new version
'    oScript = oScriptProvider.getScript("vnd.sun.star.script:Standard.Upgrade.m?language=Basic&location=document")
'    
'    'run the macro with data passed to it
'    oScript.invoke(Array(ThisComponent), Array(), Array())

    
    
    
'==============================================
'==============================================
'=============configure columns and metros here
'==============================================
'==============================================    
    

    'stores the save options of the old file
    Dim oNewSaveOptions(0) as New com.sun.star.beans.PropertyValue
    
    'stores the formatted file name
    Dim sNewFileName as String
    Dim sNewPathName as String
    
    'get the name of the current document
    sNewFileName = oNewVersionDoc.Title
    
    'get the current path and file name for the old version    doc
    sNewPathName = oOldVersionDoc.URL
    
    'remove the file:/// from the file name
    sNewPathName = Right(sNewPathName, Len(sNewPathName) - 8)

    'store the last character of the path
    Dim sNewLastChar as String
    sNewLastChar = ""
    
    'process the path name until the file name is removed
    Do Until sNewLastChar = "/"
        
        'read the last character of the path
        sNewLastChar = Right(sNewPathName,1)
        
        'if the last character is not a directory name then delete the last character
        If sNewLastChar <> "/" Then sNewPathName = Left(sNewPathName,Len(sNewPathName)-1)
    
    'keep looping until done
    Loop

    'store the location of the found %20
    Dim iNewFound20 as Integer

    'get the first %20's location
    iNewFound20 = InStr(sNewPathName,"%20")
    
    'process the path name until all of the %20's are removed
    Do Until iNewFound20 = 0

        'remove the found %20 from the path name
        Mid(sNewPathName, iNewFound20, 3, " ")
        
        'get the next location
        iNewFound20 = InStr(sNewPathName,"%20")

    'keeep looping until done        
    Loop
    
    'set the path including the file name
    sNewPathName = ConvertToURL(sNewPathName & sNewFileName)
    
    'save the file to the selected location with the user's name and date
    oNewVersionDoc.storeAsURL(sNewPathName,oNewSaveOptions())

    'close the dialogs
    oProgressDialog.Close(True)
    
End Sub
OOo 3.1 On Windows XP SP3 (Home)
Running portables of 2.4, 3.0, 3.1, and 3.2 on XP SP3 (Work)
OOo BASIC user

My contribution to the OOo Community code and more
https://sites.google.com/site/ooomacrolog/
zabolyx
Posts: 216
Joined: Fri Aug 07, 2009 7:28 pm

Re: Issues running external macro

Post by zabolyx »

Here is the code I have at the moment.

Code: Select all

REM  *****  BASIC  *****

'store the old sheet objects
Global oOldVersionDoc as Object
Global oOldVersionSheet as Object

'store the new sheet objects
Global oNewVersionDoc as Object
Global oNewVersionSheet as Object




Sub mUpgradeDownloadNewVersion(sNewVersionName as String)
	
	'close the RCF File
	oRCFDoc.Close(True)

	'store the location of the new file
	Dim sNewVersionLink as String
	
	'stores the parts of the FTP server link
	Dim sFTPUserName as String
	Dim sFTPPassword as String
	Dim sFTPAddress as String
	Dim sFTPPath as String
	Dim sFTPLink as String
		
	'get the FTP data from the internal settings sheet
	sFTPUserName = oInternalSettingsSheet.getCellRangeByName("AK56").String
	sFTPPassword = oInternalSettingsSheet.getCellRangeByName("AK57").String
	sFTPAddress = oInternalSettingsSheet.getCellRangeByName("AK55").String
	sFTPPath = oInternalSettingsSheet.getCellRangeByName("AK60").String
	
	'create the link to the new version
	sNewVersionLink = ConvertToURL("ftp://" & sFTPUserName & ":" & sFTPPassword & "@" & sFTPAddress & sFTPPath & sNewVersionName)
	
	'stores the options for opening the new version
	Dim oNewVersionOptions(0) as New com.sun.star.beans.PropertyValue

'	oNewVersionsOptions(0).Name = "Hidden"
'	oNewVersionsOptions(0).Value = False

	oNewVersionOptions(0).Name = "MacroExecutionMode"
	oNewVersionOptions(0).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
		
	'open the new file
	oNewVersionDoc = starDesktop.loadComponentFromURL(sNewVersionLink, "_blank", 0, oNewVersionOptions())
	
	'set the new version sheet object
	oNewVersionSheet = oNewVersionDoc.getSheets()

	'store the name of the new version file
	Dim sNewVersionTitle as String

	'title of new version file
	sNewVersionTitle = oNewVersionDoc.Title
	
	'setup the macro provider from the new version
	oScriptProvider = oNewVersionDoc.getScriptProvider()
  
	'assign the correct macro from the new version
	oScript = oScriptProvider.getScript("vnd.sun.star.script:Standard.Upgrade.mUpgradeGetOldData?language=Basic&location=document")
	
	'run the macro with data passed to it
	oScript.invoke(Array(ThisComponent), Array(), Array())
			
End Sub





Sub mUpgradeGetOldData(oOldVersionDoc as Object)
	
'	'stores the dialog objects
'	Dim oProgressDialog as Object
'	Dim oProgressLabel1 as Object
'	Dim oProgressLabel2 as Object
'	Dim oProgressBar1 as Object
'	Dim oProgressBar2 as Object
'
'	'call the library that controls the dialogs
'	DialogLibraries.LoadLibrary("Standard")
'	
'	'Create the dialog UNO Object
'	oProgressDialog = CreateUNODialog(DialogLibraries.Standard.DialogProgress)
'	
'	'setup the labels on the dialog
'	oProgressLabel1 = oProgressDialog.getControl("PRG-Label1")
'	oProgressLabel2 = oProgressDialog.getControl("PRG-Label2")
'	
'	'setup the progress bars
'	oProgressBar1 = oProgressDialog.getControl("PRG-Progress1")
'	oProgressBar2 = oProgressDialog.getControl("PRG-Progress2")
'	
'	'reset the labels on the dialog
'	oProgressLabel1.Text = ""
'	oProgressLabel2.Text = ""
'	
'	'reset the progressbars
'	oProgressBar1.Value = 0
'	oProgressBar2.Value = 0
	
	'lock the program from user interaction and refresh
	'should provide a speeed improvement
	

	
	'store the data of the old version file
	Dim oOldVersionSheet as Object
	
	'store the data of the new version file
	Dim oNewVersionSheet as Object
	Dim oNewVersionDoc as Object
	
	'setup the old sheet
	oOldVersionSheet = oOldVersionDoc.Sheets()
	
	'setup the new file and sheet
	oNewVersionDoc = ThisComponent
	oNewVersionSheet = oNewVersionDoc.Sheets()
	
	'stop autocalculate
	oOldVersionDoc.enableAutomaticCalculation(False)
	oNewVersionDoc.enableAutomaticCalculation(False)

	'lock the controllers
	oOldVersionDoc.lockControllers	
	oNewVersionDoc.lockControllers	
	
	'lock the user interaction
	oOldVersionDoc.AddActionLock
	oNewVersionDoc.AddActionLock
	

	'stores the old version of the software
	Dim sOldVersion as String
	
	sOldVersion = oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("W55").String & "." & oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("W56").String & ".x"
	
	'store the columns that the version data is in
	Dim sUpgradeLocations(4, 5) as String
	
	'setup the current version
	sUpgradeLocations(0, 1) = "N"
	sUpgradeLocations(0, 2) = "V"
	sUpgradeLocations(0, 3) = "Y"
	sUpgradeLocations(0, 4) = "AB"
	sUpgradeLocations(0, 5) = "AE"

	'setup the next version
	sUpgradeLocations(1, 1) = "AH"
	sUpgradeLocations(1, 2) = "AP"
	sUpgradeLocations(1, 3) = "AS"
	sUpgradeLocations(1, 4) = "AV"
	sUpgradeLocations(1, 5) = "AY"

	'setup the next version
	sUpgradeLocations(2, 1) = "BB"
	sUpgradeLocations(2, 2) = "BJ"
	sUpgradeLocations(2, 3) = "BM"
	sUpgradeLocations(2, 4) = "BP"
	sUpgradeLocations(2, 5) = "BS"

	'setup the next version
	sUpgradeLocations(3, 1) = "BV"
	sUpgradeLocations(3, 2) = "CD"
	sUpgradeLocations(3, 3) = "CG"
	sUpgradeLocations(3, 4) = "CJ"
	sUpgradeLocations(3, 5) = "CM"

	'setup the next version
	sUpgradeLocations(4, 1) = "CP"
	sUpgradeLocations(4, 2) = "CX"
	sUpgradeLocations(4, 3) = "DA"
	sUpgradeLocations(4, 4) = "DD"
	sUpgradeLocations(4, 5) = "DG"
	
	'store the found version number location to use
	Dim iFoundVersion as Integer
	iFoundVersion = 0
		
	'count through the upgrade versions to check
	For iColCounter1 = 1 to 4
		
		'check if the versions match
		If sOldVersion = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iColCounter1,1) & 3).String Then iFoundVersion = iColCounter1
		
	'next version to test
	Next iColCounter1
	
	'store the number items to copy
	Dim iDataSetsCount as Integer
	iDataSetsCount = 0
	
	'count through the rows of data to import
	For iRowCounter1 = 5 to 1004
		
		'check if there is data to get
		If oNewVersionSheet.getByName("Upgrader").getCellRangeByName("B" & iRowCounter1).String <> "" Then iDataSetsCount = iDataSetsCount + 1
				
	'next row to test for data
	Next iRowCounter1
	
	'store the password for locking and unlocking the sheets and document
	Dim sNewPassword as String
	
	'get the password from the new document
	sNewPassword = oNewVersionSheet.getByName("Internal Settings").getCellRangeByName("I55").String

	'store the password for locking and unlocking the sheets and document
	Dim sOldPassword as String
	
	'get the password from the new document
	sOldPassword = oOldVersionSheet.getByName("Internal Settings").getCellRangeByName("I55").String
	
	'store the range and sheet data from the row read
	Dim sPasteSheet as String
	Dim sCopySheet as String
	Dim sTempCol1 as String
	Dim sTempCol2 as String
	Dim sTempRow1 as String
	Dim sTempRow2 as String
	Dim sTempRange as String

'	'show the dialog
'	oProgressDialog.setVisible(True)
'	
'	'set the seconday label on the progress dialog	
'	oProgressLabel1.Text = "Copying data from old to new"
'
'	'set the secondary progressbar
'	oProgressBar1.Value = 0
'	oProgressBar2.Value = 0

	'store the data found flag
	Dim bDataFoundFlag as Boolean
	
	'store the number of rows in the test array
	Dim iTestRows as Integer
	
	'count through the data sets to copy
	For iRowCounter1 = 5 to iDataSetsCount + 4

		'clear the range data
		sPasteSheet = ""
		sCopySheet = ""
		sTempCol1 = ""
		sTempCol2 = ""
		sTempRow1 = ""
		sTempRow2 = ""
		
		'get the old versions sheets range data
		sCopySheet = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 1) & iRowCounter1).String
		sTempCol1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 2) & iRowCounter1).String
		sTempCol2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 3) & iRowCounter1).String
		sTempRow1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 4) & iRowCounter1).String
		sTempRow2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(iFoundVersion, 5) & iRowCounter1).String

		'check if the data is row, block or column based and concatenate 
		'	the data as needed
		If sTempCol2 <> "" AND sTempRow2 <> "" Then
			
			'build the range as it is a block
			sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow2
			
		'check if it is a column range
		ElseIf sTempCol2 = "" AND sTempRow2 <> "" Then
		
			'build the range as it is a column
			sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol1 & sTempRow2
		
		'check if it is a row range
		ElseIf sTempCol2 <> "" AND sTempRow2 = "" Then
		
			'build the range as it is a row
			sCopyRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow1

		'check if it is a row range
		ElseIf sTempCol2 = "" AND sTempRow2 = "" Then
		
			'build the range as it is a row
			sCopyRange = sTempCol1 & sTempRow1
		
		'end the current if statment
		End If
		
		'dump the selected range into an array
		aTestArray = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange).DataArray
		
		'get the number of rows to test in the array
		iTestRows = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange).Rows.Count
	
		'check to see if there are more than one row to test
		If iTestRows > 1 Then
			
			'reset the data found flag
			bDataFoundFlag = False
			
			'reset the temp counter
			iTempCounter1 = 0
			
			'count through the array to test array for data
			Do While iTempCounter1 <> iTestRows
						
				'test the current element for data
				If aTestArray(iTempCounter1)(0) <> "" Then
					
					'set the data found flag
					bDataFoundFlag = True
					
					'exit the current loop
					Exit Do
				
				'end the current if statement
				End If
							
				'increment the counter
				iTempCounter1 = iTempCounter1 + 1
				
			'test the next element
			Loop
		
		'if there are not more than one row
		Else
			
			'set the data found flag to force the copying of the data
			bDataFoundFlag = True
			
		'end the current if statement
		End If

		'test if the array had any data found
		If bDataFoundFlag = True Then

			'clear the range data
			sPasteSheet = ""
			sTempCol1 = ""
			sTempCol2 = ""
			sTempRow1 = ""
			sTempRow2 = ""

			'get the current sheets range data
			sPasteSheet = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 1) & iRowCounter1).String
			sTempCol1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 2) & iRowCounter1).String
			sTempCol2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 3) & iRowCounter1).String
			sTempRow1 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 4) & iRowCounter1).String
			sTempRow2 = oNewVersionSheet.getByName("Upgrader").getCellRangeByName(sUpgradeLocations(0, 5) & iRowCounter1).String
					
			'check if the data is row, block or column based and concatenate 
			'	the data as needed
			If sTempCol2 <> "" AND sTempRow2 <> "" Then
				
				'build the range as it is a block
				sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow2
				
			'check if it is a column range
			ElseIf sTempCol2 = "" AND sTempRow2 <> "" Then
			
				'build the range as it is a column
				sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol1 & sTempRow2
			
			'check if it is a row range
			ElseIf sTempCol2 <> "" AND sTempRow2 = "" Then
			
				'build the range as it is a row
				sPasteRange = sTempCol1 & sTempRow1 & ":" & sTempCol2 & sTempRow1
	
			'check if it is a row range
			ElseIf sTempCol2 = "" AND sTempRow2 = "" Then
			
				'build the range as it is a row
				sPasteRange = sTempCol1 & sTempRow1
			
			'end the current if statment
			End If		
					
			'store the copy object
			Dim oCopy as Object
			Dim oPaste as Object
	
			'unlock the sheets
			oNewVersionSheet.getByName(sPasteSheet).Unprotect(sNewPassword)
			oOldVersionSheet.getByName(sCopySheet).Unprotect(sOldPassword)
					
			'setup the copy and paste objects
			oCopy = oOldVersionSheet.getByName(sCopySheet).getCellRangeByName(sCopyRange)
			oPaste = oNewVersionSheet.getByName(sPasteSheet).getCellRangeByName(sPasteRange)
			
			'copy the data from the old document to the new document
			oPaste.DataArray = oCopy.DataArray
			
			'lock the sheets
			oNewVersionSheet.getByName(sPasteSheet).Protect(sNewPassword)
			oOldVersionSheet.getByName(sCopySheet).Protect(sOldPassword)
			
		'end the current if statement
		End If
		
		
'		'set the seconday label on the progress dialog	
'		oProgressLabel2.Text = sCopySheet & " - " & sCopyRange
'	
'		'set the secondary progressbar
'		oProgressBar1.Value = (iRowCounter1 / iDataSetsCount) * 100
'		oProgressBar2.Value = (iRowCounter1 / iDataSetsCount) * 100
		

		
	'next row to get the stuff to copy
	Next iRowCounter1


	
	'====================================	
	'====================================	
	'configure the metros
	'====================================	
	'====================================	


	'unprotect the sheet to work with
	oNewVersionSheet.getByName("Options").Unprotect(sNewPassword)
	oNewVersionSheet.getByName("Internal Settings").Unprotect(sNewPassword)
		
	'stores the locations to test for the metros set to active
	Dim sTestMetros(50) as String
	
	'stores the columns for the test locations
	Dim sTestMetroCol(5) as String
	
	'set the test columns array
	sTestMetroCol(1) = "M"
	sTestMetroCol(2) = "X"
	sTestMetroCol(3) = "AI"
	sTestMetroCol(4) = "AT"
	sTestMetroCol(5) = "BE"
	
	'store the cell string to test
	Dim sTestMetroCell as String
	
	'stores the current sTestMetro element count
	Dim iCount as Integer
	
	'set iCount to zero
	iCount = 0
	
'	'open the progress dialog
'	mProgressSetup
'
'	'set the progress dialogs labels
'	oProgressLabel1.Text = "Configuring Metros"
'	oProgressLabel2.Text = "Checking selected metros"
	
	'count through the columns to test
	For iTempCounter1 = 1 to 5
	
		'count through the rows to check
		For iTempCounter2 = 1 to 10	

			oCell = oNewVersionSheet.getByName("Options").getCellRangeByName(sTestMetroCol(iTempcounter1) & (iTempCounter2 + 7))

			'get the string from the cell to test
			sTestMetroCell = oNewVersionSheet.getByName("Options").getCellRangeByName(sTestMetroCol(iTempcounter1) & (iTempCounter2 + 7)).String
					
			'increment the array counter
			iCount = iCount + 1

			'check if the cell is checked (has an X in it)
			If sTestMetroCell = "X" OR sTestMetroCell = "x" Then
				
				'set the sTestMetros array
				sTestMetros(iCount) = 1
			
			'end the current if statement
			End If
			
'			'set the secondary progress bar
'			oProgressBar2.value = ((iTempCounter1 * iTempCounter2) / 50) * 100
'
'			'set the secondary progress bar
'			oProgressBar1.value = ((iTempCounter1 * iTempCounter2) / 50) * 100 / 2
'
		'next row to check
		Next iTempCounter2
	
	'next column to test
	Next iTempCounter1

'	'set the progress dialogs primary label
'	oProgressLabel2.Text = "Setting up selected metros"

	'count through the metros to hide
	For iTempCounter1 = 1 to 50
		
		'check if the row needs shown or hidden
		If sTestMetros(iTempCounter1) = 1 Then
				
			'show the corresponding row
			oNewVersionSheet.getByName("Options").Rows(iTempCounter1 + 26).isVisible = True
		
		'otherwise
		Else
			
			'show the corresponding row
			oNewVersionSheet.getByName("Options").Rows(iTempCounter1 + 26).isVisible = False
		
		'end the current if statement	
		End If

'		'set the secondary progress bar
'		oProgressBar2.value = (iTempCounter1 / 50) * 100
'
'		'set the secondary progress bar
'		oProgressBar1.value = ((iTempCounter1 / 50) * 100 / 2) + 50
		
	'next row to hide or show
	next iTempCounter1
	
	'protect the sheet to work with
	oNewVersionSheet.getByName("Options").Protect(sNewPassword)
	oNewVersionSheet.getByName("Internal Settings").Protect(sNewPassword)



	'====================================	
	'====================================	
	'configure the Process columns
	'====================================	
	'====================================	



	'unprotect the sheet to work with
	oNewVersionSheet.getByName("Process").Unprotect(sNewPassword)
	
	'store the string from the column being tested
	Dim sTestColumn as String
	
'	'open the progress dialog
'	mProgressSetup
'	
'	'set the progress dialogs labels
'	oProgressLabel1.Text = "Configuring the Process sheet columns"
'	oProgressLabel2.Text = ""
	
	'count through the columns to test for
	For iColCounter1 = 1 to 56
		
		sTestColumn = oNewVersionSheet.getByName("Options").getCellByPosition(iColCounter1 + 1, 98).String
		
		'check if the column is checked
		If sTestColumn = "X" OR sTestColumn = "x" Then
			
			'set the column on the process sheet as visible
			oNewVersionSheet.getByName("Process").Columns(iColCounter1).isVisible = True
			
		'otherwise
		Else
			
			'hide the column on the process sheet
			oNewVersionSheet.getByName("Process").Columns(iColCounter1).isVisible = False
			
		'end the current if statement
		End If

'	'set the progress bar
'	oProgressBar1.Value = (iColCounter1 / 56) * 100
'	oProgressBar2.Value = (iColCounter1 / 56) * 100
		
	'next column to test for
	Next iColCounter1
	
	'protect the sheet to work with
	oNewVersionSheet.getByName("Process").Protect(sNewPassword)
	
	
	
	
	
	'====================================	
	'====================================	
	'configure the MAP History columns
	'====================================	
	'====================================	
	
	'protect the sheet to work with
	oNewVersionSheet.getByName("MAP History").Unprotect(sNewPassword)
	
'	'store the string from the column being tested
'	Dim sTestColumn as String
	
'	'open the progress dialog
'	mProgressSetup
'	
'	'set the progress dialogs labels
'	oProgressLabel1.Text = "Configuring the History sheet columns"
'	oProgressLabel2.Text = ""
	
	'count through the columns to test for
	For iColCounter1 = 1 to 56
		
		sTestColumn = oNewVersionSheet.getByName("Options").getCellByPosition(iColCounter1 + 1, 106).String
		
		'check if the column is checked
		If sTestColumn = "X" OR sTestColumn = "x" Then
			
			'set the column on the process sheet as visible
			oNewVersionSheet.getByName("MAP History").Columns(iColCounter1 + 1).isVisible = True
			
		'otherwise
		Else
			
			'hide the column on the process sheet
			oNewVersionSheet.getByName("MAP History").Columns(iColCounter1 + 1).isVisible = False
			
		'end the current if statement
		End If

'	'set the progress bar
'	oProgressBar1.Value = (iColCounter1 / 56) * 100
'	oProgressBar2.Value = (iColCounter1 / 56) * 100
		
	'next column to test for
	Next iColCounter1
	
	'protect the sheet to work with
	oNewVersionSheet.getByName("MAP History").Protect(sNewPassword)	
	
	'unloch the controllers
	oOldVersionDoc.unlockControllers	
	oNewVersionDoc.unlockControllers	
	
	'reenable the autocalculate
	oOldVersionDoc.enableAutomaticCalculation(True)
	oNewVersionDoc.enableAutomaticCalculation(True)
	
	'unlock the user interaction
	oOldVersionDoc.RemoveActionLock
	oNewVersionDoc.RemoveActionLock
	

	
	'====================================	
	'====================================	
	'save the new version
	'====================================	
	'====================================	
	

	'stores the save options of the old file
	Dim oNewSaveOptions(0) as New com.sun.star.beans.PropertyValue
	
	'stores the formatted file name
	Dim sNewFileName as String
	Dim sNewPathName as String
	
	'get the name of the current document
	sNewFileName = oNewVersionDoc.Title
	
	'get the current path and file name for the old version	doc
	sNewPathName = oOldVersionDoc.URL
	
	'remove the file:/// from the file name
	sNewPathName = Right(sNewPathName, Len(sNewPathName) - 8)

	'store the last character of the path
	Dim sNewLastChar as String
	sNewLastChar = ""
	
	'process the path name until the file name is removed
	Do Until sNewLastChar = "/"
		
		'read the last character of the path
		sNewLastChar = Right(sNewPathName,1)
		
		'if the last character is not a directory name then delete the last character
		If sNewLastChar <> "/" Then sNewPathName = Left(sNewPathName,Len(sNewPathName)-1)
	
	'keep looping until done
	Loop

	'store the location of the found %20
	Dim iNewFound20 as Integer

	'get the first %20's location
	iNewFound20 = InStr(sNewPathName,"%20")
	
	'process the path name until all of the %20's are removed
	Do Until iNewFound20 = 0

		'remove the found %20 from the path name
		Mid(sNewPathName, iNewFound20, 3, " ")
		
		'get the next location
		iNewFound20 = InStr(sNewPathName,"%20")

	'keeep looping until done		
	Loop
	
	'set the path including the file name
	sNewPathName = ConvertToURL(sNewPathName & sNewFileName)
	
	'save the file to the selected location with the user's name and date
	oNewVersionDoc.storeAsURL(sNewPathName,oNewSaveOptions())

'	'close the dialogs
'	oProgressDialog.Close(True)

	'====================================	
	'====================================	
	'save the old version as a back up and delete
	'====================================	
	'====================================	



	'stores the save options of the old file
	Dim oOldSaveOptions(0) as New com.sun.star.beans.PropertyValue
	
	'stores the formatted file name
	Dim sFileName as String
	Dim sPathName as String
	
	'get the name of the current document
	sFileName = oOldVersionDoc.Title
	
	'store the old versions name for deleting
	Dim sOldName as String
	
	'get the old versions name
	sOldName = sFileName
	
	'add the backup name to the file
	sFileName = Left(sFileName,Len(sFileName) - 4) & ".bak"
		
	'get the current path and file name for the old version	doc
	sPathName = oOldVersionDoc.URL
	
	'remove the file:/// from the file name
	sPathName = Right(sPathName, Len(sPathName) - 8)

	'store the last character of the path
	Dim sLastChar as String
	sLastChar = ""
	
	'process the path name until the file name is removed
	Do Until sLastChar = "/"
		
		'read the last character of the path
		sLastChar = Right(sPathName,1)
		
		'if the last character is not a directory name then delete the last character
		If sLastChar <> "/" Then sPathName = Left(sPathName,Len(sPathName)-1)
	
	'keep looping until done
	Loop

	'store the location of the found %20
	Dim iFound20 as Integer

	'get the first %20's location
	iFound20 = InStr(sPathName,"%20")
	
	'process the path name until all of the %20's are removed
	Do Until iFound20 = 0

		'remove the found %20 from the path name
		Mid(sPathName, iFound20, 3, " ")
		
		'get the next location
		iFound20 = InStr(sPathName,"%20")

	'keeep looping until done
	Loop
	
	'store the old document's path and name
	Dim sOldPath as String
	
	'get the old document's path before saving it
	sOldPath = sPathName

	'set the path including the file name
	sPathName = ConvertToURL(sPathName & "Backup/" & sFileName)
	
	'save the file to the selected location with the user's name and date
	oOldVersionDoc.storeAsURL(sPathName,oOldSaveOptions())

	'delete the old file from the 
	Kill (sOldPath & sOldName)

	'close the old version needs to go here
	oOldVersionDoc.Close(True)

	'alert the user that the upgrade is complete
	MsgBox "Upgrade Complete!"
	
	'open the web broswer to the changelog for the new version
	'combine the various elements into the compiled url
	CompiledURL = "https://sites.google.com/site/mapmasterj/change-log/version-" & oNewVersionSheet.getByName("Internal Settings").getCellRangeByName("W55").String & "-" & oNewVersionSheet.getByName("Internal Settings").getCellRangeByName("W56").String & "-0"
	
	'call and open the url shell service
	oChangeLog = createUNOService("com.sun.star.system.SystemShellExecute")
	oChangeLog.execute(CompiledURL,,0)


	
	'====================================	
	'====================================	
	'run through the startup sequence
	'====================================	
	'====================================	
	
		
	
	'get the project variables set
	mMainInitialize	

	'setup the mouse event listener
	sStartXMouseClickHandler
	
	'setup the keyboard key event listener
	sStartXKeyHandler
	
	'setup the context menu event listener
	registerContextMenuInterceptor
	
	'hide the toolbars
	HideAllBars

	'check if this is not new version
	If oInternalSettingsSheet.getCellRangeByName("Y22").String = "" Then
	
		'check the rcf
		RCFupdater
	
	'end the current if statement
	End If

End Sub
But I'm still unable to use dialogs within the new spreadsheet.

This ends up being a major issue as this code runs fairly slow and there is no way of showing the user where we are in the upgrade process. Also now that I have learned the beauty of the .DataArray and .setDataArray I'm hoping to improve the handling of the upgrade engine.

Any suggestions on what I can do to improve this code?... in my rewrite I'm looking to make more and more segments broken out as routines of there own to reuse more and more code.... as well as creating more segments as functions to help streamline the processes.
OOo 3.1 On Windows XP SP3 (Home)
Running portables of 2.4, 3.0, 3.1, and 3.2 on XP SP3 (Work)
OOo BASIC user

My contribution to the OOo Community code and more
https://sites.google.com/site/ooomacrolog/
Post Reply