Solved

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

Posted on 2013-11-12
4
753 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

717 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