Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Excel's VBA < Word's VBA?

I program using VBA for Word. I've imported some forms and code from a
Word project into Excel, but there are lots of issues. Is there a web
page I can go to to help distinguish the many differences between VBA
for Excel and VBA for Word?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel's VBA < Word's VBA?

Sonny,

The actual VBA used by Excel and Word is the same. The difference
lies in the object models of the Excel and Word applications.
Aside from books about Word and Excel programming, you can use
the Object Browser to see the object models.

Perhaps you could start by asking specific questions.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Sonny Maou" wrote in message
...
I program using VBA for Word. I've imported some forms and code

from a
Word project into Excel, but there are lots of issues. Is there

a web
page I can go to to help distinguish the many differences

between VBA
for Excel and VBA for Word?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Excel's VBA < Word's VBA?

Chip Pearson wrote:
Sonny,

The actual VBA used by Excel and Word is the same. The difference
lies in the object models of the Excel and Word applications.
Aside from books about Word and Excel programming, you can use
the Object Browser to see the object models.

Perhaps you could start by asking specific questions.


Thanks, Chip. I wanted to RTFM before I got into specific questions...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Excel's VBA < Word's VBA?

Chip Pearson wrote:

Perhaps you could start by asking specific questions.


Chip, the following code works in Word. Why doesn't it work in Excel? If
they are the "same VBA," why doesn't the constant wdUserTemplatesPath
work in Excel like it does in Word? How would the code below need to be
written to work in Excel?

Public Function dirPath(x)
Dim temp
If x = "user" Then
temp = Options.DefaultFilePath(wdUserTemplatesPath)
Else
temp = Options.DefaultFilePath(wdWorkgroupTemplatesPath)
End If
dirPath = temp
End Function

Thanks! :)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Excel's VBA < Word's VBA?

Sonny: For the same reason a Ford key won't work in a Chevy. While the
engines both burn gas, the "keys" to make them run are different. So, too,
Excel and Word are different in what they do and how they do it, and the
commands needed to instruct the different programs to function. The prefix
"wd" is a dead giveaway that the instruction or parameter is specific to
Word.

Ed

"Sonny Maou" wrote in message
...
Chip Pearson wrote:

Perhaps you could start by asking specific questions.


Chip, the following code works in Word. Why doesn't it work in Excel? If
they are the "same VBA," why doesn't the constant wdUserTemplatesPath
work in Excel like it does in Word? How would the code below need to be
written to work in Excel?

Public Function dirPath(x)
Dim temp
If x = "user" Then
temp = Options.DefaultFilePath(wdUserTemplatesPath)
Else
temp = Options.DefaultFilePath(wdWorkgroupTemplatesPath)
End If
dirPath = temp
End Function

Thanks! :)





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Excel's VBA < Word's VBA?

Ed so kindly wrote:

Sonny: For the same reason a Ford key won't work in a Chevy.


Well, a Ford engine will work in a Chevy, with a little mod... maybe
that's a better analogy. or maybe not. :/

engines both burn gas, the "keys" to make them run are different. So, too,
Excel and Word are different in what they do and how they do it, and the
commands needed to instruct the different programs to function. The prefix
"wd" is a dead giveaway that the instruction or parameter is specific to
Word.


Yeah, I was hopin' for some real live compatibility between two
Microsoft Office apps. heh. Some may say I'm a dreamer... :)

Of course, I see the need for specific and necessarily incompatible
objects to represent each app's "docs"... I'm just bein' a whiner for a
moment. Thank you. :P

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel's VBA < Word's VBA?

You can certainly automate on Office application from another.
They work together quite nicely in that respect. In VBA, go to
the Tools menu, choose References, and select the Microsoft Word
object library.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Sonny Maou" wrote in message
...
Ed so kindly wrote:

Sonny: For the same reason a Ford key won't work in a Chevy.


Well, a Ford engine will work in a Chevy, with a little mod...

maybe
that's a better analogy. or maybe not. :/

engines both burn gas, the "keys" to make them run are

different. So, too,
Excel and Word are different in what they do and how they do

it, and the
commands needed to instruct the different programs to

function. The prefix
"wd" is a dead giveaway that the instruction or parameter is

specific to
Word.


Yeah, I was hopin' for some real live compatibility between two
Microsoft Office apps. heh. Some may say I'm a dreamer... :)

Of course, I see the need for specific and necessarily

incompatible
objects to represent each app's "docs"... I'm just bein' a

whiner for a
moment. Thank you. :P



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an Excel 2003 equivalent to Word's "versions" function? Steve Excel Discussion (Misc queries) 0 March 4th 07 02:01 AM
Symbols added to Word's AutoCorrect don't appear in Excel Abby Excel Discussion (Misc queries) 4 December 15th 06 02:37 AM
Excel counterpart to Word's ctrl-] ? MatthewS Excel Discussion (Misc queries) 1 November 21st 06 01:54 AM
Is there something like Word's "CREATEDATE" function in Excel? - ML - Excel Discussion (Misc queries) 5 July 25th 05 09:26 PM
How to know the excel's constant Hidayat Excel Programming 9 January 2nd 04 11:27 PM


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"