Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Office XP VBA can't find reference after saving by Office 2003 | Excel Programming | |||
Microsoft.Office.Tools reference | Excel Programming | |||
NamedRange in Tools for Office 2003? | Excel Programming | |||
Visual Studio Tools for Microsoft Office System 2003 | Excel Programming | |||
Reference to Office 11.0 Object Library | Excel Programming |