one too many
12-13-2008, 02:16 PM
I have a macro written which makes envelopes from a word template .doc file (it's an DL envelope with fields: "name", "surname", "address" and "city" for mail merging) and a .xls data base.It's written in Excel 2007 (Slovene language).
I have problems with compatibility. It only works on my computer! My brother has the same Office (of course he has Excel and Word installed) but WinXP (I have Vista Businees) and it stops when macro gets to the Word part of code (I had include Word 12.0 object library). I forgot what was the error, but I think it was " Compile error: Can't find project or library" at first line of word code.
On other computers (older Office) it's not working at all. It stops at first line (Sub Kuverte()). The error is: " Compile error: Can't find project or library".
Guess library aren't backward compatible? But why it doesn't work on other office 2007?
I copied code in excel 2000 VB and then stops with error "Named argument not found"
WdDoc.MailMerge.OpenDataSource Name:= _
FilePath(ThisWorkbook.FullName) & "Kopijaclanstvo+2008-09.xls", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=ExcelAdress;Mode=Read;"Extended Properties=""HDR=YES;IMEX=1;""; _
Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=35;Jet OLEDB" _
, SQLStatement:="SELECT * FROM `'Za Posiljanje$'`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess It stops in the last line (SubType:=wdMergeSubTypeAccess)
I have problems with compatibility. It only works on my computer! My brother has the same Office (of course he has Excel and Word installed) but WinXP (I have Vista Businees) and it stops when macro gets to the Word part of code (I had include Word 12.0 object library). I forgot what was the error, but I think it was " Compile error: Can't find project or library" at first line of word code.
On other computers (older Office) it's not working at all. It stops at first line (Sub Kuverte()). The error is: " Compile error: Can't find project or library".
Guess library aren't backward compatible? But why it doesn't work on other office 2007?
I copied code in excel 2000 VB and then stops with error "Named argument not found"
WdDoc.MailMerge.OpenDataSource Name:= _
FilePath(ThisWorkbook.FullName) & "Kopijaclanstvo+2008-09.xls", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=ExcelAdress;Mode=Read;"Extended Properties=""HDR=YES;IMEX=1;""; _
Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=35;Jet OLEDB" _
, SQLStatement:="SELECT * FROM `'Za Posiljanje$'`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess It stops in the last line (SubType:=wdMergeSubTypeAccess)