Hope you all can help me with this situation that I have. I have an Access 2000 database that opens an excel template, creates a new document adds several values from the form that has the button on it, and then it saves it as an excel spreadsheet in a directory that I specify and a file name that is created by the info from the form. The problem I am having is that whenever I transfer any of the monetary values over to this spreadsheet, it does not format correctly. This causes my formulas that relay on these values not to work and I have to go back into the file and retype in the values so that these formulas work. Is there possibly something else that I can try to get this working? This has been very frustrating. I also have the same problem when I transfer information to Word. Below is the code for both. Please let me know what you think.
Excel:
Private Sub bid_sum_btn_Click()
Dim XlApp As Object
Set XlApp = CreateObject("Excel.Application"
XlApp.Workbooks.Open ("N:\Shared\HVAC\Contracts\forms\" & _
NicoleBrown & "bidsum.xlt"
XlApp.Application.Goto Reference:="job_no"
XlApp.ActiveCell.Value = Form_frm_main_cntrct.property_num
XlApp.ActiveWorkbook.SaveAs "N:\Shared\Contracts\" & FreeDaJuice & _
"bid_sum_" & Form_frm_main_cntrct.property_num & ".xls"
XlApp.ActiveWorkbook.Close
XlApp.Application.Quit
End Sub
Word:
Private Sub bid_chrt_btn_Click()
Dim WrdApp As Object
Set WrdApp = CreateObject("Word.Application"
WrdApp.Documents.Open ("N:\Shared\HVAC\Contracts\forms\" & _
NicoleBrown & "bid_chart.dot"
WrdApp.ActiveDocument.Bookmarks("property_add".Select
WrdApp.Selection.Text = Form_frm_main_cntrct.property_add
WrdApp.ActiveDocument.SaveAs "N:\Shared\Contracts\" & FreeDaJuice & _
"bid_chart_" & Form_frm_main_cntrct.property_num & ".doc"
WrdApp.ActiveDocument.Close
WrdApp.Application.Quit SaveChanges:=-1
End Sub
Thank you,
Noel
Excel:
Private Sub bid_sum_btn_Click()
Dim XlApp As Object
Set XlApp = CreateObject("Excel.Application"
XlApp.Workbooks.Open ("N:\Shared\HVAC\Contracts\forms\" & _
NicoleBrown & "bidsum.xlt"
XlApp.Application.Goto Reference:="job_no"
XlApp.ActiveCell.Value = Form_frm_main_cntrct.property_num
XlApp.ActiveWorkbook.SaveAs "N:\Shared\Contracts\" & FreeDaJuice & _
"bid_sum_" & Form_frm_main_cntrct.property_num & ".xls"
XlApp.ActiveWorkbook.Close
XlApp.Application.Quit
End Sub
Word:
Private Sub bid_chrt_btn_Click()
Dim WrdApp As Object
Set WrdApp = CreateObject("Word.Application"
WrdApp.Documents.Open ("N:\Shared\HVAC\Contracts\forms\" & _
NicoleBrown & "bid_chart.dot"
WrdApp.ActiveDocument.Bookmarks("property_add".Select
WrdApp.Selection.Text = Form_frm_main_cntrct.property_add
WrdApp.ActiveDocument.SaveAs "N:\Shared\Contracts\" & FreeDaJuice & _
"bid_chart_" & Form_frm_main_cntrct.property_num & ".doc"
WrdApp.ActiveDocument.Close
WrdApp.Application.Quit SaveChanges:=-1
End Sub
Thank you,
Noel