Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an old VB6 application that creates Excel workbooks which include
pivot tables, graphing, forms and vba code to handle button and double-click events on the workbook. This was coded with some old version of MsOffice and has been working fine for a number of years including with Office 2003. I'm encountering a number of issues when attempting to run this VB6 application with Office 2007. The first problem is while the VB6 application is assigning a range to the PrintArea, i.e. "With xlSheet.PageSetup.PrintArea = strTemp" where strTemp has a value = $A$5:$E$18. The error returned to VB6 is -2147352560 Automation error Invalid callee. I can get around this error by changing the line of code to be: .PrintArea = xlApp.ActiveCell.PivotTable.TableRange2.Address Not quite certain why this is happening or this bypasses the error but at least a workbook gets created and populated with data. The bigger problem is that the workbook that gets created with Excel 2007 does NOT contain the various VBA objects and code. Some code stubs are created but don't contain inner code. e.g. Private Sub cmdBreakdown_Click() End Sub but if run with Excel 2003 this procedure contains code such as: Private Sub cmdBreakdown_Click() Dim intCol As Integer, intTemp As Integer intTemp = 15 intCol = 131 Do Until Cells(intTemp, intCol) = "" If Trim(Cells(intTemp, intCol)) = strBreakdownLevel1 And Trim(Cells(intTemp, intCol + 1)) = strBreakdownLevel2 And Trim(Cells(intTemp, intCol + 2)) = strBreakdownLevel3 Then lngBreakdownSum = lngBreakdownSum + Cells(intTemp, intCol + 5) End If intTemp = intTemp + 1 Loop DataBreakdown.Show End Sub In Excel 2007 under Macro Security I have enable all ActiveX controls, enabled all macros, allowed Trust access to the VBA project, enable all data connections, etc. Any ideas of what changed between office 2003 and office 2007 that is preventing these code items, forms and modules from getting copied from the VB6 application into the workbook ? regards. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUMIF formula works in Excel 2003, does not work in Excel 2007 | Excel Discussion (Misc queries) | |||
function =IFERROR LOOKUP works in excel 2007 not in excel 2003 | Excel Worksheet Functions | |||
Automation multiversion excel 2003-2007 | Excel Programming | |||
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 | Excel Discussion (Misc queries) | |||
chart works in excel 2007, not 2003 | Excel Programming |