It looks like AutoCAD did not do a very good job here: when a new layout is created (by clicking "+" at bottom beside the layout tabs), a new layout is created, and the current plot device name is assigned (i.e. "ConfigName" property is set). However, the property "CanonicalMediaName" is not assigned (i.e. it is an empty string value), until the layout is activated (user clicks the layout tab to make it active), at this moment either AutoCAD assigns "CanonicalMediaName" to a default value (if the "Show Page Setup Manager for new layout" check box is not selected in "Options"); or the Page Setup Manager pops up to force user choose a print media.
In my opinion, it could be consider as a minor bug in AutoCAD side: if user did not check the box of "Show Page Setup Manager for new layout", when new layout is created, not only the default device name should be set, as it already does, but also "CanonicalMediaName" should be set to default without having to wait until user activates the layout.
Now that we know the reason why the "Publish" UI showing "Layout not initialized" (meaning the layout has not been activated for the first time), the workaround (assume you want to programmatically do the publishing), you can do one of the following:
1. Loop through all layouts to make each active once. This may result in time-consuming "Regen" what switching active layout, though. The code would be like:
Public Sub ActivateEveryLayout()
Dim curLay As AcadLayout
Dim curSpace As AcActiveSpace
curSpace = ThisDrawing.ActiveSpace
Set curLay = ThisDrawing.ActiveLayout
Dim lay As AcadLayout
ThisDrawing.ActiveSpace = acPaperSpace
For Each lay In ThisDrawing.Layouts
If UCase(lay.Name) <> "MODEL" Then
ThisDrawing.ActiveLayout = lay
End If
Next
ThisDrawing.ActiveSpace = curSpace
ThisDrawing.ActiveLayout = curLay
End Sub
2. You can simply test each layout's "CanonicalMediaName", if it is empty, then it is not "initialized":
Dim lay as layout
For Each lay in ThisDrawing.Layouts
If Len(lay.CanonicalMediaName) = 0 Then
Msgbox "Layout """ & lay.Name & """ is not initialized!"
End If
Next
HTH