By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

Spreadsheet Creation from VB

P: 1
Here is some old code this is no longer working, I included the CreateSpreadsheet module.

When I kick this off i get an error 438 - Object does not support this property

I am extremely frustrated!!!!! Any help would be apprectated! Thanks!

Dim objAccess As Object
Dim dbName As String
Dim strWhere As String

Set objAccess = CreateObject("Access.Application")
With objAccess
.OpenCurrentDatabase filepath:=gstrDBName
.DoCmd.Open "CreateSpreadsheet"
End With
Set objAccess = Nothing
Exit Sub

Public Sub CreateSpreadSheet()
On Error GoTo B
Dim SourceFile As String, DestinationFile As String
Dim FileName As String
FileName = "DIR-Report"

SourceFile = CurrentProject.Path & "\Export.xls"
DestinationFile = CurrentProject.Path & "\" & FileName & ".xls"
DestinationFile = "C:\Documents and Settings\All Users\Desktop" & "\" & FileName & ".xls"
FileCopy SourceFile, DestinationFile 'Copy source to target.

WriteSheet DestinationFile

Exit Sub


MsgBox "An Error has occured!"
Resume A

End Sub
Sep 23 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.