Excel Vba Runtime Error 438 Combobox
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings excel vba runtime error 438 object doesn't support and policies of this site About Us Learn more about Stack Overflow excel vba runtime error 438 object doesn't support this property or method the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation run time error 438 excel vba Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it
Run Time Error 438 Vba Excel 2010
only takes a minute: Sign up Accessing ComboBox ListIndex, Run-time error '438', xls vs xlsm? up vote 1 down vote favorite 1 I have a code that takes values from one excel sheet, and puts them into the same spot in another sheet. This includes ComboBox indexes as well as Cell values. Both spreadsheets have the same structure and the same form elements, but one sheet has a different image as a header. Here's the line that error's out: Workbooks(Template).Sheets(Sheet1).ComboBox12.ListIndex = Workbooks(OriginalFile).Sheets(Sheet1).ComboBox12.ListIndex Template and OrignalFile are filenames, Sheet1 is a worksheet tab name, and ComboBox12 exists as "ComboBox12" in both files. So here's the problem. When I run the script that first opens the two files and then runs a bunch of these commands, it errors out with "Run-time error '438' Object doesn't support this property of method". But if I run the line of code while both files are already open, it runs just fine. To make things even more interesting, running the code on 97-2003 .xls files works perfectly. And it seems it doesn't make a difference what version the template file is. Only when the original file is a .xlsm version does the code error out. (I can still run after they're both open from VBA window) To prove it was the file version causing the change in behavior I took a .xls file that the code worked fine on and saved it as a .xlsm
Forums Excel Questions Manipulating Combo-box properties in VBA Results 1 to 7 of 7 Manipulating Combo-box properties in VBAThis is a discussion on Manipulating Combo-box properties in VBA within the Excel Questions forums, part of the Question Forums category; Hello Excellers!! I'm trying to write a procedure that, amongst other things, puts a combo-box on a worksheet and then ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded http://stackoverflow.com/questions/25318379/accessing-combobox-listindex-run-time-error-438-xls-vs-xlsm Mode Jun 2nd, 2005,08:51 AM #1 IAVENOIDEAWHAIMDOIN Board Regular Join Date Nov 2004 Location www.thelanes-uk.com Posts 291 Manipulating Combo-box properties in VBA Hello Excellers!! I'm trying to write a procedure that, amongst other things, puts a combo-box on a worksheet and then specifies the properties of it. I'm getting "Run-time error '438': Object doesn't support this property or method" ...annoyingly when I'm presented with the http://www.mrexcel.com/forum/excel-questions/144248-manipulating-combo-box-properties-visual-basic-applications.html error dialog it doesn't enable me to "Debug" so I'm not entirely sure which line of code this error is being caused by. This is relevent code that I'm using in a module based sub... Code: Sheets("SurfaceWaterConcentrationsOutpu").Select Range("A1").Select ActiveSheet.OLEObjects.Add ClassType:="Forms.ComboBox.1", _ Link:=False, DisplayAsIcon:=False, Left:=560.25, Top:=246.75, _ Width:=142.5, Height:=28.5 With Sheets("SurfaceWaterConcentrationsOutpu").ComboBox1 .ListFillRange = Linksheet & "!A1:A" & LastSeries + 1 .LinkedCell = Linksheet & "!A" & LastSeries + 2 .ListRows = LastSeries + 1 .Value = "All" End With The Combo-box appears on the worksheet so I assume the "Add" function is working fine. Can anyone see where I'm going wrong with the "With" statement that I'm using? Cheers, Martin. Share Share this post on Digg Del.icio.us Technorati Twitter Thanks to MrExcel.com... INOWAVESOMEIDEAWHAIMDOIN. Reply With Quote Jun 2nd, 2005,10:32 AM #2 IAVENOIDEAWHAIMDOIN Board Regular Join Date Nov 2004 Location www.thelanes-uk.com Posts 291 I'm not getting very far with this. I've got as far as changing it to... Dim ComboList As String Dim ComboLink As String ComboList = Worksheets(Linksheet).Range(Cells(1, 1), Cells(LastSeries + 1, 1)).Address ComboLink = Worksheets(Linksheet).Range(Cells(LastSeries + 2, 1).Address).Address Sheets("SurfaceWaterConcentrationsOutp").Select With Sheets("SurfaceWaterConcentrationsOutp") Set cb = .OLEObjects.Add(ClassType:="Forms.ComboBox.1", _ Link:=False, DisplayAsIcon:=False, Left:=560.25, Top:=246.75, _ Width:=142.5, Heig
Way | Trading Add-ins For Excel | Convert Excel Into Calculating Web Pages Excel Web Pages | Produce Clean Efficient VBA Code Every Time http://www.ozgrid.com/forum/showthread.php?t=34808 | Build Automated Trading Models In Excel | Excel Web Pages | Excel Video Training Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts What's New? Advanced Search Forum HELP FORUMS Excel General Accessing ComboBox Properties in one Run Excel Training / Excel Dashboards Reports If this is your first visit, be sure to check error 438 out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. If you don't like Google AdSense in the posts, register or log in above. Click here to view the relaunched Ozgrid time error 438 newsletter. Page 1 of 2 1 2 Last Jump to page: Results 1 to 10 of 16 Thread: Accessing ComboBox Properties in one Run Thread Tools Show Printable Version Search Thread Advanced Search June 7th, 2005 #1 ozgridmember View Profile View Forum Posts I agreed to these rules Join Date 7th May 2005 Posts 15 Accessing ComboBox Properties in one Run Puzzle: The code example below causes an "Object doesn't support this property or method (Error 438)" message. The Compiler sees the word "ComboBox1" in the code before it gives itself a chance to create the Object and make references to it as a Member of the Sheet it was created in. Question: How can Code be used to add a ComboBox to a worksheet and set properties such as Fonts and FillColor for that ComboBox without using or adding a Form? (See: Experiment Goals and the Code example below for a better explanation.) Experiment goals: Without using the Forms Toolbar and without adding a Form to the Project. In VBA code, 1. Add a ComboBox to a Worksheet. 2. For