| Mrrrr's Forum (VIEW ONLY) Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
 | Lista Forumurilor Pe Tematici | 
	
		| Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login 
 POZE MRRRR'S FORUM (VIEW ONLY)
 
 Nu sunteti logat.
 | Nou pe simpatie: amy70 la Simpatie.ro
 
 |  | Femeie 24 ani
 Bucuresti
 cauta Barbat
 31 - 59 ani
 | 
 | 
	
		| 
				
					| 
							TRaPModerator
 
 Inregistrat: acum 7 ani
 Postari: 856
 |  | 
				
					| I've encountered several problems using a simple Workbook_Open subroutine. While it seemed to work fine yesterday in testing, today when I opened Excel I get error that Personal.XLSB is corrupted. I couldn't save it in any way I tried, fortunately I had a backup and the exported modules since the backup. I think I got all back.
 
 Anyway, this is the code that had errors today:
 
 
 | Private Sub Workbook_Open() If ActiveWorkbook.Name = "AAA BBBB CCCC.xlsx" Then
 Worksheets("Sheet1").Range("G1") = "CLASSIC"
 End If
 End Sub
 | 
 
 Here's the code that works fine, apparently, at least so far (after a few tests) - added this in PERSONAL.xlsb, in ThisWorkbook:
 
 
 | Public WithEvents App As Application
 
 Private Sub Workbook_Open()
 Set App = Application
 End Sub
 
 Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
 If Wb.Name = "AAA BBBB CCCC.xlsx" Then
 Wb.Worksheets("Sheet1").Range("G1") = "CLASSIC"
 End If
 End Sub
 
 | 
 
 Source:
 
 
 |  | 
	
		| pus acum 1 an |  | 
	
		| 
				
					| 
							TRaPModerator
 
 Inregistrat: acum 7 ani
 Postari: 856
 |  | 
				
					| The 2nd code above still works fine today. 
 So it passed the test.
 
 
 |  | 
	
		| pus acum 1 an |  |