Thread: Excel Report
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
MichiSu11 MichiSu11 is offline
external usenet poster
 
Posts: 1
Default Excel Report

Hi
I don't know how to do it from Access. But I have an Excel Workbook, that I prepared as Template Workbook for Reports. This Template Workbook has Sub Workbook_Open() = is called when the Template Workbook is opened. Here I do data fetching from any database and if necessary formatting. Then I remove the code from the workbook and save it under a new name. (not overwrite the template workbook with the code!

Good luck Mich

If interested Code Removal works like this
Public Sub DeleteProjects(project As VBProject

' delete the source-code from a specific VBA-projec

' Example invocation
' DeleteProjects Application.VBE.ActiveVBProjec

' First tries to delete all Modules (Class, Form, Standard
' Then it empties undeleteable Modules (like ThisWorkbook...
' After this Sub all Source-code should be gone, but th
' calling procedure still finishes execution even after th
' source is deleted
Dim VBComp As VBIDE.VBComponen
Dim VBComps As VBIDE.VBComponent

Set VBComps = project.VBComponent

For Each VBComp In VBComp
With VBComp.CodeModul
.DeleteLines 1, .CountOfLine
End Wit
Select Case VBComp.Typ
Case vbext_ct_StdModule, vbext_ct_MSForm,
vbext_ct_ClassModul
VBComps.Remove VBCom
End Selec
Next VBCom
End Sub