Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there an Excel 2003 equivalent to Word's "versions" function? | Excel Discussion (Misc queries) | |||
Symbols added to Word's AutoCorrect don't appear in Excel | Excel Discussion (Misc queries) | |||
Excel counterpart to Word's ctrl-] ? | Excel Discussion (Misc queries) | |||
Is there something like Word's "CREATEDATE" function in Excel? | Excel Discussion (Misc queries) | |||
How to know the excel's constant | Excel Programming |