Macworld Forums: Opening Excel from Word Macro - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Opening Excel from Word Macro

#1 User is offline   JonDavie Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 21-October 04

Posted 21 October 2004 - 01:02 PM

How can I get a Macro running in Office X Word to open a workbook in Excel? I tried recording the macro, but as soon as I left the Word environment to open the workbook it stopped recording. I would just look in the help files, but our lovely system admin must have thought that nobody would use them.
0

#2 User is offline   shades Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 344
  • Joined: 28-June 02

Posted 21 October 2004 - 03:15 PM

The recorder won't help you in this.
To get started, go into the VBE and go to Tools > References. In the resulting window, scroll to find the Object library for Microsoft Excel (number) Object Library, and check it. This allows you to access Excel application and commands.
Another pointer, you have to Dim the application so that you have a means of accessing it. Here is a helpful site for both Windows and Mac Word. Look at the section on VBA (one note: the site does not display in the latest version of Safari, nor Netscape).
http://word.mvps.org/FAQs/index.htm
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users