Counting Weekdays then export to Excel

  • Thread starter Thread starter Ian B
  • Start date Start date
I

Ian B

Hi

I'm trying to work on a module that counts the weekdays
between two dates. This part I have managed, but I am
unable to export this information into Excel, unless I cut
and paste (which is something I loathe to do. Can anyone
help?
 
You need to use OLE Automation

Sub Some2Excel(
Dim ExcApp As Excel.Applicatio
Dim ExcWbk As Excel.Workboo
Dim ExcWsh As Excel.Workshee

'new instance of Exce
Set ExcApp = CreateObject("Excel.Application"
'open a workboo
Set ExcWbk = ExcApp.Workbooks.Open("FileName"
'here You can add you dat
Set ExcWsh = ExcWbk.Worksheets("Name").Range("A1") = "some data
'here You can set visible for Excel applicatio
'and many many other thing

Set ExcWsh = Nothin
Set ExcWbk = Nothin
Set ExcApp = Nothin
End Su
 
Back
Top