S
Sarah_Lecturer
I have some code - which until today - was working perfectly:
Sub AddPONo()
Order = System.PrivateProfileString("\\server\dept$\IT\New Purchase
Orders\Settings.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 508
Else
Order = Order + 1
End If
System.PrivateProfileString("\\server\dept$\IT\New Purchase
Orders\Settings.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "IT00000#")
ActiveDocument.SaveAs FileName:="\\server\dept$\IT\New Purchase Orders\" &
Format(Order, "IT00000#")
End Sub
When I run the code I get an error message :
System Error &H0004005 (-2147467259)
Any suggestions would be fantastic!
Thanks in advance for your help
Sarah xx
Sub AddPONo()
Order = System.PrivateProfileString("\\server\dept$\IT\New Purchase
Orders\Settings.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 508
Else
Order = Order + 1
End If
System.PrivateProfileString("\\server\dept$\IT\New Purchase
Orders\Settings.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "IT00000#")
ActiveDocument.SaveAs FileName:="\\server\dept$\IT\New Purchase Orders\" &
Format(Order, "IT00000#")
End Sub
When I run the code I get an error message :
System Error &H0004005 (-2147467259)
Any suggestions would be fantastic!
Thanks in advance for your help
Sarah xx