473,396 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Excel to Word macros

I am trying to export excel data to word and came up with the code as below:

[code] ......

Dim appWord As Word.Application
Dim appdoc As Object
Dim docname As String



If Sheets("Peer Review - Service Portfolio").Range("B4").Value <> "" Then

Set appWord = CreateObject("Word.Application")

appWord.Visible = True
Sheets("Peer Review - Standard Factors").Range("B11:P1217").Copy

appWord.Documents.Add ("C:\Documents and Settings\Desktop\Smart scoping model\Limiting factors Word Output\Temp.doc")

appWord.Selection.PasteAndFormat (wdFormatPlainText)

Application.CutCopyMode = False


appWord.Activate
docname = appWord.Name
docname = "Limitin"
docname = docname & ".doc"
appWord.ActiveDocument.SaveAs docname, wdformat


End of Code}

I am getting the error user type undefined or not defined against the line


Dim appWord As Word.Application

Can anyone see the error in this?
Aug 31 '07 #1
0 921

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Prakash | last post by:
Hi, We face problems uploading excel (with macros) documents using HTML File Upload. The file contents are corrupted while viewing the same. However, we are able to upload excel (w/o. macros)...
3
by: OhMyGaw | last post by:
Hello Excel/automation Gurus, I am working on an application where I have to keep a centralized database of all macros distributed to user and save the changes back on a nightly basis back to...
4
by: Mr.Doubt | last post by:
I've a widows application, that makes use of an EXCEL COM object, to run a few macros available in a EXCEL file. The object is created when the app is started and is closed when the app is closed....
1
by: Dartish | last post by:
Hi all, Thanks in advance for the help I have a DLL that which has several functions that I can call in Excel. I am thinking of how to call these functions in a .net project (authored in C#)....
3
by: jeremy.bird | last post by:
I am looking for a possible solution or bump in the right direction when working with excel on the web. Currently I am using and developing in visual studio 2005. Here is the situation I have a lot...
1
by: putermikey | last post by:
Hi All New to Forum, Need a little help with my script if you could any one can help. I have created a script to look for dates. current date and past 5 dates. the script only works if the...
9
by: M K | last post by:
I would like to write code to export to excel, outlook and word. Any idea where a good resource to look? I know about using the VBA macros as I have done that in lotus notes ( but that is VB to...
8
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a web site that automates excel. This site runs in server 2003. iis 6.0 office 2003 installed I moved this app to server 2008 iis 7.0 office 2003 installed Now when I try to automate...
1
by: pnalla | last post by:
hi how to create a word documetn using Excel macros.. i have some code but it crating a word document but it isnot close properly whats the proble. please suggest me. thanks prasad
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.