Good morning (in W. Europe )
I’m working with a scripting dictionary composed with instances of a custom class of mine and of course it can’t be registered. My solution in order to keep the relative data is to write my instances’ information into an userform, make a screen capture of the usf and paste it into a dedicated workbook. I have in a standard module the code opening my userform (fiche_ind, sorry, names are in French) and in the usf module the code for the screen capture (please see below): The problem ist that after the instruction opening the userform nothing else occurs: the evenemential sub doesn’t start. I tried to have the whole code in the standard module but then the prtscr captured the code page !
The userform code
Thank you for any help or explanation.
Regards
Pierre
I’m working with a scripting dictionary composed with instances of a custom class of mine and of course it can’t be registered. My solution in order to keep the relative data is to write my instances’ information into an userform, make a screen capture of the usf and paste it into a dedicated workbook. I have in a standard module the code opening my userform (fiche_ind, sorry, names are in French) and in the usf module the code for the screen capture (please see below): The problem ist that after the instruction opening the userform nothing else occurs: the evenemential sub doesn’t start. I tried to have the whole code in the standard module but then the prtscr captured the code page !
Code:
'ouvre le classeur d'images =opens the img workbook
Workbooks("images_compos.xlsx").Activate
ActiveWorkbook.ActiveSheet.Name = NomComplet
fiche_ind.Show ' a userform
Code:
Private Sub fiche_ind_Initialize()
Dim Ws As Worksheet
Dim legende As String
Dim photo As Object
SendKeys (PRTSC)
Workbooks("images_compos.xlsx").Activate
ActiveWorkbook.ActiveSheet.Name = NomComplet
With ActiveSheet.PageSetup
'...
End With
With ActiveSheet
With New DataObject
.GetFromClipboard
End With
.Cells(1, 1).value = legende
.Range(Cells(2, 1), Cells(25, 11)).Select
End With
ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Regards
Pierre