When working in the host drawing (the one that is open in CAD and visible) I use ApplicationServices.Application.SetSystemVariable. What do i use (if it is even possible) to set variables in a drawing being accessed remotely via this method..
Using TargetDB As New Database(False, True)
TargetDB.ReadDwgFile(Me.TabControl1.TabPages(DWGPath).Tag, System.IO.FileShare.Read, True, "")
'set variable(s) here
TargetDB.SaveAs(TargetDB.OriginalFileName, True, TargetDB.OriginalFileVersion, TargetDB.SecurityParameters)
End using
??