View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Workbook_open Event


Public WithEvents App As Application

Private Sub App_WorkbookOpen(ByVal Wb As Workbook)

If Wb.FileFormat = xlCSV Then

Call myMacro
End If
End Sub

Private Sub Workbook_Open()
Set App = Application
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
__________________________________
HTH

Bob

"Hassan" wrote in message
...
Hi All,

How I can run macro when only CSV format file opened.

Thanks

Hassan