Convert VBA from Excel Application
Posted: Tue Mar 27, 2012 2:01 am
I have an Excel workbook with VBA forms that pulls data from and writes data to an MS Access database. The application connects to an external electronic device that captures flow data. The data that configures the device is stored in the Access database. Data from the device is delivered live to the excel workbook where it's forumlated for usefulness. This workbook as a lot of VBA code to make everything work.
I'd like to have end users be able to run this application in Calc. I read that OpenOffice has a built in VB compatibility mode or add on that will allow Excel applications to run in Calc without converting all the VBA code. Did some research but no able to verify if this is possible.
I really don't want to have to start over with new coding from scratch. I'm not really a programmer but I've muddles my way through VBA effectively. Here's an example of some VBA code from the workbook for a combo box on a VBA form in the application. The form allows for .mdb table data changes to configure the electronic device.
Any help will be much appreciated.
Regards,
Larry
Will such an application run in Calc?
Is there a tool to convert all the VBA code to native openoffice code?
Title Edited. A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply (Hagar, Moderator).
I'd like to have end users be able to run this application in Calc. I read that OpenOffice has a built in VB compatibility mode or add on that will allow Excel applications to run in Calc without converting all the VBA code. Did some research but no able to verify if this is possible.
I really don't want to have to start over with new coding from scratch. I'm not really a programmer but I've muddles my way through VBA effectively. Here's an example of some VBA code from the workbook for a combo box on a VBA form in the application. The form allows for .mdb table data changes to configure the electronic device.
Any help will be much appreciated.
Regards,
Larry
Will such an application run in Calc?
Is there a tool to convert all the VBA code to native openoffice code?
Code: Select all
Private Sub CboFlowRanges_Change()
DataqSdk1.Stop
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\program files\flowsoft\data\FlowSoft.mdb")
Set rs = db.OpenRecordset("configuration")
Orifice = rs.Fields(14)
CD = rs.Fields(16)
rs.Edit
rs!OrificeDiameter.Value = CboFlowRanges.Column(0)
rs!DischargeCoefficient.Value = CboFlowRanges.Column(1)
rs.Update
Call GetConfig
Call Start_Click
'place the CFM Range number from cboflowranges combo box on the worksheet
Worksheets("flowsoftexcel").Range("b5").Value = CboFlowRanges.Column(2)
TextCFMRange.Value = CboFlowRanges.Column(2)
End Sub