G
Guest
My thanks Jean-Guy Marcil....
Have attached my posting from yesterday, which Doug
Robbins (MVP) responded to.... his reasoning for why the
code might not be working (i.e., all users on the network
would need to have read/write permissions to the folder)
makes some sense however, I don't think this is gonna
happen. He did not address the "error message". Also - I
checked with our IT department and they logged onto a
machine that had read/write permissions to the folder and
they got the same message (below). Our macro security
here in the department is set to low because we use virus
protection as well as have a very agressive firewall.
Following an article contributed by Doug Robbins (MVP)I
set up a form template with the intent of having the form
self-number everytime an employee used "File New". The
template resides on the company network. (Employees have
read permissions to the directory/folder)in order to
access the template.
I have inserted an AutoNew macro for autonumbering (see
Doug Robbins (MVP)handiwork with mods below)into a form
template. The bookmark the text file is
dumping into is in an unprotected section of the
template. Both template and accompanying text file reside
on a common server in the same folder. The
problem? It works fine from my computer and another
computer in my office,(both machines have read/write
access to the directory/folder where the template is
stored)(elation! huzza huzza!) but does not work from
other computers on the network (despair! very unhappy
face!). The employees have read rights to the folder
where the template resides through a tab within word.
When the user selects "FileNew", the file opens and
hesitates, like it is trying to pull it together, then
they get a Visual Basic error which reads:
Method 'PrivateProfileString' of object 'System' Failed. I
don't have a clue what the message is trying to tell me,
especially since it works great in the department but
fails everywhere else. Any help in figuring this one out
would be greatly appreciated by myself as well as my
users.. best regards
----------------------------------------
Sub AutoNew()
'
' AutoNew Macro
' Macro created 9/17/2003 by XXXXXX
'
ReqNo = System.PrivateProfileString("\\NTServer\
Settings.Txt", "MacroSettings", "ReqNo")
If ReqNo = "" Then
ReqNo = 0
Else
ReqNo = ReqNo + 1
End If
System.PrivateProfileString
("\\NTServer\Settings.Txt", "MacroSettings", "ReqNo") =
ReqNo
ActiveDocument.Bookmarks("ReqNo").Range.InsertBefore Format
(ReqNo, "00000#")
ActiveDocument.SaveAs FileName:="ReqNo" & Format
(ReqNo, "00000#")
End Sub
Have attached my posting from yesterday, which Doug
Robbins (MVP) responded to.... his reasoning for why the
code might not be working (i.e., all users on the network
would need to have read/write permissions to the folder)
makes some sense however, I don't think this is gonna
happen. He did not address the "error message". Also - I
checked with our IT department and they logged onto a
machine that had read/write permissions to the folder and
they got the same message (below). Our macro security
here in the department is set to low because we use virus
protection as well as have a very agressive firewall.
Following an article contributed by Doug Robbins (MVP)I
set up a form template with the intent of having the form
self-number everytime an employee used "File New". The
template resides on the company network. (Employees have
read permissions to the directory/folder)in order to
access the template.
I have inserted an AutoNew macro for autonumbering (see
Doug Robbins (MVP)handiwork with mods below)into a form
template. The bookmark the text file is
dumping into is in an unprotected section of the
template. Both template and accompanying text file reside
on a common server in the same folder. The
problem? It works fine from my computer and another
computer in my office,(both machines have read/write
access to the directory/folder where the template is
stored)(elation! huzza huzza!) but does not work from
other computers on the network (despair! very unhappy
face!). The employees have read rights to the folder
where the template resides through a tab within word.
When the user selects "FileNew", the file opens and
hesitates, like it is trying to pull it together, then
they get a Visual Basic error which reads:
Method 'PrivateProfileString' of object 'System' Failed. I
don't have a clue what the message is trying to tell me,
especially since it works great in the department but
fails everywhere else. Any help in figuring this one out
would be greatly appreciated by myself as well as my
users.. best regards
----------------------------------------
Sub AutoNew()
'
' AutoNew Macro
' Macro created 9/17/2003 by XXXXXX
'
ReqNo = System.PrivateProfileString("\\NTServer\
Settings.Txt", "MacroSettings", "ReqNo")
If ReqNo = "" Then
ReqNo = 0
Else
ReqNo = ReqNo + 1
End If
System.PrivateProfileString
("\\NTServer\Settings.Txt", "MacroSettings", "ReqNo") =
ReqNo
ActiveDocument.Bookmarks("ReqNo").Range.InsertBefore Format
(ReqNo, "00000#")
ActiveDocument.SaveAs FileName:="ReqNo" & Format
(ReqNo, "00000#")
End Sub