B
Brennan
I am using the code below to automate the transfer of information from Access
to Excel. Right now, the code creates a file, modifies it and saves it. I
would to change the code so that it prompts the user for the file into which
data is transfered and then keeps it open for review. How do I change the
code to accomplish this? Thanks for your help!
Dim xlobject As Object, xlsheet As Object
Set xlobject = CreateObject("excel.sheet.5")
Set xlsheet = xlobject.Application.activeworkbook.sheets("sheet1")
With xlsheet
.range("b1").Value = "Presale"
.range("c1").Value = "Postsale"
.range("d1").Value = "Total P&L"
.range("a2").Value = "Consulting Revenue"
.range("b2").Value = PreCR
.range("c2").Value = PostCR
.range("d2").Value = CR
.Cells(1, 1).Font.Size = 25
End With
xlsheet.Parent.SaveAs "C:\Documents and
Settings\bs185075\Desktop\xltest.xls"
xlobject.Application.Quit
Set xlobject = Nothing
Brennan
to Excel. Right now, the code creates a file, modifies it and saves it. I
would to change the code so that it prompts the user for the file into which
data is transfered and then keeps it open for review. How do I change the
code to accomplish this? Thanks for your help!
Dim xlobject As Object, xlsheet As Object
Set xlobject = CreateObject("excel.sheet.5")
Set xlsheet = xlobject.Application.activeworkbook.sheets("sheet1")
With xlsheet
.range("b1").Value = "Presale"
.range("c1").Value = "Postsale"
.range("d1").Value = "Total P&L"
.range("a2").Value = "Consulting Revenue"
.range("b2").Value = PreCR
.range("c2").Value = PostCR
.range("d2").Value = CR
.Cells(1, 1).Font.Size = 25
End With
xlsheet.Parent.SaveAs "C:\Documents and
Settings\bs185075\Desktop\xltest.xls"
xlobject.Application.Quit
Set xlobject = Nothing
Brennan