I've inherited an old Excel 2003 application, and need to convert it so that it works in Excel 2007. The application makes use of a spreadsheet as a "popup" inside the application for doing volume calculations. In Excel 2003, this works as expected. In Excel 2007, VBA complains with an "Object Required" error.
Browsing through the Object Browser, Excel 2003 lists "VolSheet" as a Spreadsheet object. Excel 2007 can't find it at all. Excel 2007 does list "VolSheet" as a Shape if you loop through all shapes (ActiveSheet.Shapes), however.
My question is: Is there a way to force Excel 2007 to recognize VolSheet as a spreadsheet? Would I have to Dim it somewhere and find a way to convert the Shape reference to a spreadsheet? Can I trick Excel 2007 into recognizing that it does in fact already exist inside one of the Worksheets?
Seems like you need to update your install of OWC on the 2007 machine
Office Web Components version 11 initially did not support Office 2007, but was updated to add it in SP1. See Link and Link for a security patch.
Related
The question is there are 'n' different ppts and I want to put all the ppts in one single ppt. Condition is I should not use copy paste rather I should write a function in excel using macros to get it done. So how do I do this?
It looks like you need to automate PowerPoint from Excel. The How to automate PowerPoint by using Visual Basic in Office 2003, in Office XP Developer, and in Office 2000 Developer article describes all the required steps for getting the job done. Be aware, the reference number corresponds to the Office installed on your machine. For example:
Microsoft PowerPoint 15.0 Object Library
Stands for PowerPoint 2013 and etc.
I have a VB6 application running for years. This application always reference Excel 2003 in the past for creating XLS files. Now we would like to use Excel 2010 in place of 2003. So I installed only Excel 2010 on a separate dev computer and load my vb6 project.
When running the app, I got the error where my 'Microsoft Excel 10.0 Object Library' is missing. This is true because only Excel 2010 is installed on this computer and no more Excel 2003.
The problem is that when I would like the correct reference, I didn't find any 'Microsoft Excel 14.0 Object Library' or something equivalent for replacing this reference.
Any suggestion?
Thanks.
Early bound reference are "bound" (excuse the pun) to cause a problem on applications being distributed to users with different Excel versions.
Using late binding and coding for the earliest version of Excel you are willing to support is the solution. For example, if you were supporting Excel 2000, your application would only use methods supported in Excel 2000.
However, if your code was late bound, you could use ambiguous method calls and detect the local version to determine which code to run.
Ex:
Dim excelVersion As Long
Dim xl As Object
' get a reference to Excel.Application maybe from AddinInstance_OnConnection()?
excelVersion = Val(xl.Version)
Select Case excelVersion
Case 11 ' Excel 2003
' Excel 2003-only methods here
' ex: xl.FileSearch
Case 12 ' Excel 2007
' Excel 2007-only methods here
Case 14 ' Excel 2010
' Excel 2010-only methods here
' ex: something with Slicers
End Select
Since the code is late bound (i.e. derived from Object), I can specify methods that are valid only in Excel 2010 and the code will still compile. If the code was early bound to Excel 2003, it wouldn't compile. At runtime I determine the version to decide which methods to use.
You might also consider compiling different versions of your application, if you are using Excel 2010-specific features. Only you would know if that is possible.
Also, and I thought of this after writing this answer, but can't you reference Excel 2010 in your app, and if it is installed on computers with earlier versions of Excel, won't the reference automatically adjust to whatever version of Excel is installed?
I prepared a spreadsheet where I used the drop down list command in several cells (data validation, list). I needed to provide two versions of the same spreadsheet: one saved as Excel 2007 file, and the other one as Excel 2010 file.
If I open the Excel 2007 file with Excel 2010, in the cells where I inserted the drop down list, the reference to the cells that contain the list is somehow changed and the drop down list shows the wrong data.
For example, if I specify to use as the data in the list the values of cells C20:C25, when I open the file with Excel 2010 the cells are changed to D15:D20. I did not find a trend in the "shifting" of the referenced cells.
How do I prevent this without using Excel 2007 for the 2007 file only and Excel 2010 for the 2010 file only?
I have found a workaround that works for me.
If this is your original dropdown box formula:
=Sheet2!A1:A5
Then change it to:
=INDIRECT("Sheet2!A1:A5")
For me, this stops it removing the dropdown when opening in Excel 2007 after saving in Excel 2010. I found this out accidentally because I needed INDIRECT to define my dropdown range, as it varied.
Jeremy
I found the answer here: http://www.ozgrid.com/forum/showthread.php?t=150080
"If your dropdown is a data validation list and you have used a list on another sheet as the
source, then you need to do what Tayt said, since versions pre-2010 cannot refer directly to
a range on another sheet and the validation will simply disappear."
That solved my problem; hopefully it'll solve yours.
You are opening a 2007 file with 2010, saving it and closing it. Perhaps 2010 is automatically converting your file to the 2010 format.
Have you tried intentionally telling 2010 to save your file in the 2007 format?
I solved this by having both Excel 2007 and 2010 installed.In Excel 2010 I selected the cell that should have contained the dropdown-list and then pressed data validation from the data tab. I just copied the values in excell 2007 and saved.
If you find the sheet to be protected, you can use this solution : http://mcgimpsey.com/excel/removepwords.html
Hope it helps
My PC has both Excel 2003 and 2007 as well as the Excel 2007 compatibility pack installed, it also has a VB script that build records into an csv file automatically. Recently, the number of records that are needed to dump into the file has grown significantly and went beyond the row limit in Excel 2003. As such, I made a copy of the same file and saved it into .xlsm format.
However, when I use the VBScript to run the macro behind the Excel spreadsheet by calling:
Set myApp = CreateObject("Excel.Application")
The Excel file still attempted to open itself to convert (using the compatibility pack) to Excel 2003 and run in Excel 2003, which inevitably gives an error every time it runs.
Is there any way I could force Excel.Application to point to Excel 2007 instead of Excel 2003?
Thanks!
I had a similar experience, I am running office 2010 and i want to use the Office agents available until Office 2003.
so I installed Excel 2003 on my box and i didnt worked.
I found this post and tried all options.
reaseaching i found that i should use:
Set myApp = CreateObject("Excel.Application.11")
for office 2003 but it didnt work.
All my testing was done in VBSedit software, which shows that it was using the office 2003, but it was actually opening 2007.
I tried with primalscript and is working like a charm.
I think this might help others.
Try:
Set myApp = CreateObject("Excel.Application.12")
see http://support.microsoft.com/kb/292491
there:
For testing purposes, developers can force a specific version of an Office application to register by using the /regserver switch on the command line. For example, to force an Excel version to register without running setup, you can use a command line that resembles the following:
"c:\program files\microsoft office\office\excel.exe" /regserver
I have built an excel spreadsheet with filters and formulas. When I change the format from 2007 to 97-2003 and then send it to a client, the filters are no longer there and they don't work.
How can I save a 2007 excel spreadsheet as a 2003 file type without losing functionality?
A problem can be that some functions(like COUNTIFS()) are strictly a function found in 2007 .They are not a valid function in 2003.
If this is not the case then just save in 03 format and you are good to go.