ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP how can I do this PLEASE!!!!!!!!!!! (https://www.excelbanter.com/excel-programming/390473-help-how-can-i-do-please.html)

RocketMan[_2_]

HELP how can I do this PLEASE!!!!!!!!!!!
 
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As
Boolean)
Call SClassModule.SSave

End Sub

It will compile but If I try to save it, I get Error 424 Object
Required.

Yes, its in the ThisWorkbook module.


moon

HELP how can I do this PLEASE!!!!!!!!!!!
 
U can not 'call' a class-module because it's an object.
What happens when you try this:

Private CMod As SClassModule

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As
Boolean)

Set CMod = New SClassModule
CMod.SSave

End Sub



"RocketMan" schreef in bericht
oups.com...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As
Boolean)
Call SClassModule.SSave

End Sub

It will compile but If I try to save it, I get Error 424 Object
Required.

Yes, its in the ThisWorkbook module.




Norman Jones

HELP how can I do this PLEASE!!!!!!!!!!!
 
Hi RocketMan,

Perhaps you should be using your SClassModule's
App_WorkbookBeforeSave event procedure.


---
Regards,
Norman


"RocketMan" wrote in message
oups.com...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As
Boolean)
Call SClassModule.SSave

End Sub

It will compile but If I try to save it, I get Error 424 Object
Required.

Yes, its in the ThisWorkbook module.




RocketMan[_2_]

HELP how can I do this PLEASE!!!!!!!!!!!
 
WHO HO!!!!!!!!!!!!!!!!!!!!!

THAT DID IT

THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!


Norman Jones wrote:
Hi RocketMan,

Perhaps you should be using your SClassModule's
App_WorkbookBeforeSave event procedure.


---
Regards,
Norman


"RocketMan" wrote in message
oups.com...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As
Boolean)
Call SClassModule.SSave

End Sub

It will compile but If I try to save it, I get Error 424 Object
Required.

Yes, its in the ThisWorkbook module.




All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com