Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Same Office 2003 but different VBA ToolsReference (object ref

I did uncheck "MISSING:MS Word 11.0 Office Lib". Infact I went to victim's PC
to select ToolsReference "MS Word 9.0 Office Lib". It worked & code
execution went forward ....but only until it bumps into the below, where I
actually call VBA Word from Excel.

Below is an exerpt of a sub's sub-procedure which calls for Word assistance.
Perhaps it is this which made 11.0 Offlice Lib reference & mandate as macro
haults at "wdCRLF" or "wXYZ" & stuffs with prefix like that.

Private Sub
SaveACopyOfTextFilesIntoLocalDrive_And_Convert_UNI X_text_detect_with_CRLF()
Dim WordApp As Object

Set WordApp = CreateObject("Word.Application")
On Error GoTo ErrorHandler:
With WordApp
' isbp004
.Documents.Open iPath & "\" & iFN_isbp004, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_isbp004,
FileFormat:=wdFormatText, AddToRecentFiles:=True, Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_isbp004).Close False

' isbp005
.Documents.Open iPath & "\" & iFN_isbp005, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_isbp005,
FileFormat:=wdFormatText, AddToRecentFiles:=True, Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_isbp005).Close False

' 168OPO
.Documents.Open iPath & "\" & iFN_168OPO, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_168OPO,
FileFormat:=wdFormatText, AddToRecentFiles:=True ', Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_168OPO).Close False
End With
Set WordApp = Nothing
Exit Sub

ErrorHandler:
Msg = "Please ensure that you are properly connected to the server " &
vbCrLf
Msg = Msg & "before attemting to rerun this application. "
MsgBox Msg, vbCritical, APPNAME & " (UNABLE TO CONTACT SERVER)"
Call ProtocolOnExit
End 'terminate

End Sub

--
Edmund
(Using Excel XP)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Same Office 2003 but different VBA ToolsReference (object ref

Do you want to change reference via code?

--
Regards,

Halim



"Edmund" wrote:

I did uncheck "MISSING:MS Word 11.0 Office Lib". Infact I went to victim's PC
to select ToolsReference "MS Word 9.0 Office Lib". It worked & code
execution went forward ....but only until it bumps into the below, where I
actually call VBA Word from Excel.

Below is an exerpt of a sub's sub-procedure which calls for Word assistance.
Perhaps it is this which made 11.0 Offlice Lib reference & mandate as macro
haults at "wdCRLF" or "wXYZ" & stuffs with prefix like that.

Private Sub
SaveACopyOfTextFilesIntoLocalDrive_And_Convert_UNI X_text_detect_with_CRLF()
Dim WordApp As Object

Set WordApp = CreateObject("Word.Application")
On Error GoTo ErrorHandler:
With WordApp
' isbp004
.Documents.Open iPath & "\" & iFN_isbp004, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_isbp004,
FileFormat:=wdFormatText, AddToRecentFiles:=True, Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_isbp004).Close False

' isbp005
.Documents.Open iPath & "\" & iFN_isbp005, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_isbp005,
FileFormat:=wdFormatText, AddToRecentFiles:=True, Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_isbp005).Close False

' 168OPO
.Documents.Open iPath & "\" & iFN_168OPO, ReadOnly:=True,
Format:=wdOpenFormatAuto, Encoding:=1252
.ActiveDocument.SaveAs oPath & "\" & oFN_168OPO,
FileFormat:=wdFormatText, AddToRecentFiles:=True ', Encoding:=437,
LineEnding:=wdCRLF
.Documents(oFN_168OPO).Close False
End With
Set WordApp = Nothing
Exit Sub

ErrorHandler:
Msg = "Please ensure that you are properly connected to the server " &
vbCrLf
Msg = Msg & "before attemting to rerun this application. "
MsgBox Msg, vbCritical, APPNAME & " (UNABLE TO CONTACT SERVER)"
Call ProtocolOnExit
End 'terminate

End Sub

--
Edmund
(Using Excel XP)

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
Office XP VBA can't find reference after saving by Office 2003 [email protected] Excel Programming 1 August 29th 06 11:57 AM
Microsoft.Office.Tools reference Dev Excel Programming 0 June 7th 06 07:37 PM
NamedRange in Tools for Office 2003? Lars Schouw Excel Programming 0 October 21st 05 06:13 AM
Visual Studio Tools for Microsoft Office System 2003 Regina Rodler Excel Programming 2 March 8th 05 01:34 PM
Reference to Office 11.0 Object Library Steph[_3_] Excel Programming 1 September 29th 04 08:08 PM


All times are GMT +1. The time now is 08:30 AM.

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

About Us

"It's about Microsoft Excel"