I want to export tables from database access to excel
but , i want to have a template ready made in excel
and when i do export the table records, it should go to that excel template file with pre formatted culmns
You could export to a disposable excel file and have your formatted file linked to that one as its source of data. This solution works if the data you export is of a similar size each time.
what i said before , is what i seen somewhere , when they clickd the button all the records from access exported to excel template and automatically placed in the cells formated in excel
You can then run a macro in the spreadsheet to format and save the spreadsheet file. This code has worked through Access97 to Access 2003 for me.
Dim mno As String
Set XLApp = GetObject(, "Excel.Application")
If Err <> 0 Then
Set XLApp = CreateObject("Excel.Application")
End If
On Error GoTo Err_Handle
TemplateFile = "\\Server\Folder\Subfolder\spreadsheet.XLS"
XLApp.workbooks.Open TemplateFile
f = RunMacro("FormatFont")
XLApp.Application.Quit
Set XLApp = Nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.