Solved

What is a VBA error 438 and how do I resolve it ?

Posted on 2013-11-12
4
713 Views
Last Modified: 2013-11-12
Hi,

I have a very simple macro which, on a click of a button, takes text values from an Excel sheet and populates placeholders in a Word document. However, I'm getting an 'Error 438 Object doesn't support this method or property'.

I've selected the 'Microsoft Excel 14.0 Object Library' entry in Tools --> References if that has anything to do with it.

I've attached the Excel workbook and (as EE doesn't allow the upload of .docm files) a docx file with the macro code pasted beneath the placeholder code.

Thanks
XL-Test.xlsm
Microsoft-References.jpg
Excel-to-Word-Test-1--docx-.docx
0
Comment
Question by:Tocogroup
  • 2
4 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39640947
Your supplied xl file is xl-test whereas your script calls for xl test ... i.e. file name with and without hyphen

Chris
0
 

Author Comment

by:Tocogroup
ID: 39640959
Hi Chris,

The XL file I uploaded was 'XL Test.xlsm'. So I can only assume EE replaces spaces in filenames with a hyphen. It did the same with the Word document I uploaded.

Anyway, having changed my script to point at XL-Test.xlsm the macro still falls over at the following line:

   ThisDocument.teCourseType.Caption = exWb.Sheets("Training").Cells(3, 5)

Toco
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 39641023
teCourseType is an ActiveX text box control. It does not have a Caption property. Try '.Text' instead.
0
 

Author Closing Comment

by:Tocogroup
ID: 39641091
Thank you. That was exactly the problem.
Much appreciated
Toco
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now