![]() |
|
|
|
#1
|
|||
|
|||
|
I've added MS Excel Objects and it now works and opens the file, but only if specifically run rather than automatically. My code is currently as follows:
Code:
PrivateSub runOnOpen
Call openExcel
Call UpdateAllFields
End Sub
Sub openExcel()
Dim excelApp As Excel.Application
Dim openExcel As Workbook
Dim var1 As Integer
Set excelApp = New Excel.Application
Set openExcel = excelApp.Workbooks.Open("filename")
excelApp.Visible = True
End Sub
Sub UpdateAllFields()
Application.DisplayAlerts = False
ActiveDocument.Fields.Update
Application.DisplayAlerts = True
End Sub
|
|
#2
|
||||
|
||||
|
You should look at the topic of auto macros for Word; Your 'runOnOpen' macro is named incorrectly for that.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| vba word |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Opening word document from excel 2013
|
Aurelius | Excel Programming | 1 | 03-12-2017 01:47 PM |
Opening excel from word
|
AXbean | Word VBA | 2 | 02-26-2017 12:59 AM |
Hyperlinks error msg on opening in Excel, Word
|
matilda | Excel | 3 | 05-04-2015 07:06 AM |
Word Document Not Opening With Excel VBA
|
JennEx | Word VBA | 3 | 06-20-2013 10:10 AM |
| Slow Opening Word and Excel files | itoa | Office | 1 | 05-11-2009 02:01 PM |