![]() |
|
#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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Aurelius | Excel Programming | 1 | 03-12-2017 01:47 PM |
![]() |
AXbean | Word VBA | 2 | 02-26-2017 12:59 AM |
![]() |
matilda | Excel | 3 | 05-04-2015 07:06 AM |
![]() |
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 |