Counting Weekdays then export to Excel

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?
 
L

losmac

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top