| | |
copy excel file
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi everybody,
Help PLEASE!!
I'm sure it something simple but I can't seem get my mind around
it right now.
I am exporting data from a current access form to an excel
spreadsheet then I am copying that data to an existing excel
workbook where the data will be used as the backend for and
excel invoice form. (I am using 2 workbooks because I can't
figure out how to output the data to the specific workbook and
sheet that I will use so I am trying to copy it there but I
can't get that to work either. Would someone please review what
I have and give me some guidance, please.
Private Sub EMail_Click()
Dim xLS As Object
Dim TempWbk As Object
Dim Sheet As String
Dim DestSheet As String
Set xLS = CreateObject("Excel.Application")
With xLS
.Workbooks.Open ("C:\temp\granite\Global Financial Adjustment
Form.XLS")
.Application.Visible = True
.Sheets("Sheet2").Select
End With
DoCmd.OutputTo acOutputForm, "frmGlobalAdjustment", _
acFormatXLS, "C:\temp\granite\Holding Form.XLS", True
Sheet = ActiveWorkbook
DestSheet = ("C:\temp\granite\Global Financial Adjustment
Form.XLS")
ActiveWorkbooks(Sheet).Sheets(frmGlobalAdjustment).Move_
after = Workbooks("Destsheet").Sheets(1)
End Sub
Thank you,
Melody
Help PLEASE!!
I'm sure it something simple but I can't seem get my mind around
it right now.
I am exporting data from a current access form to an excel
spreadsheet then I am copying that data to an existing excel
workbook where the data will be used as the backend for and
excel invoice form. (I am using 2 workbooks because I can't
figure out how to output the data to the specific workbook and
sheet that I will use so I am trying to copy it there but I
can't get that to work either. Would someone please review what
I have and give me some guidance, please.
Private Sub EMail_Click()
Dim xLS As Object
Dim TempWbk As Object
Dim Sheet As String
Dim DestSheet As String
Set xLS = CreateObject("Excel.Application")
With xLS
.Workbooks.Open ("C:\temp\granite\Global Financial Adjustment
Form.XLS")
.Application.Visible = True
.Sheets("Sheet2").Select
End With
DoCmd.OutputTo acOutputForm, "frmGlobalAdjustment", _
acFormatXLS, "C:\temp\granite\Holding Form.XLS", True
Sheet = ActiveWorkbook
DestSheet = ("C:\temp\granite\Global Financial Adjustment
Form.XLS")
ActiveWorkbooks(Sheet).Sheets(frmGlobalAdjustment).Move_
after = Workbooks("Destsheet").Sheets(1)
End Sub
Thank you,
Melody
•
•
Join Date: Feb 2007
Posts: 114
Reputation:
Solved Threads: 8
Try this
vb Syntax (Toggle Plain Text)
Private Sub EMail_Click() Dim objXL As Excel.Application Dim objWB As Excel.Workbook DoCmd.OutputTo acOutputForm, "frmGlobalAdjustment", _ acFormatXLS, "C:\temp\granite\Global Financial Adjustment Form.XLS", True Set objXL = New Excel.Application Set objWB = objXL.Workbooks.Open("C:\temp\granite\Global Financial Adjustment Form.XLS") objXL.Visible = True Set objWB = Nothing Set objXL = Nothing End Sub
Last edited by davidcairns; May 2nd, 2007 at 6:49 am.
![]() |
Similar Threads
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- Unable to create an excel file in VB.net (VB.NET)
- Manipulate Excel file using C++?? (C++)
- read excel records in asp not refreshing (is the excel file cached) (ASP)
- grabbing source from excel file (was: please, somebody help me!!!) (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Making intractive graphics
- Next Thread: Some help please
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





