I use Access to open an existing Excel file and fill in some fields. It then saves it as a new name and closes it. The only problem is when the user opens the new file, they see nothing until the Window is Unhid. Here is my code from Access.
Dim strFileName As String
Dim strFileLocation As String
Dim objExlCAR As Object
strFileName = "MKCAR" & Me.[CAR No] & ".xls"
strFileLocation = "C:\"
strAttachment = strFileLocation & strFileName
Set objExlCAR = GetObject(strFileLocation & "CAR.xls")
With objExlCAR.Sheets("Corrective Action")
.Cells(8, 2) = Me![Part Name]
.Cells(8, 11) = Me![Part No]
.Cells(11, 1) = Me![Quality Issue]
.Cells(17, 3) = Me![Response Due Date]
.Cells(18, 3) = Me![Name of Issuer]
End With
objExlCAR.SaveAs strFileLocation & strFileName
objExlCAR.Close
Set objExlCAR = Nothing
I am not sure how to combat this.
Dim strFileName As String
Dim strFileLocation As String
Dim objExlCAR As Object
strFileName = "MKCAR" & Me.[CAR No] & ".xls"
strFileLocation = "C:\"
strAttachment = strFileLocation & strFileName
Set objExlCAR = GetObject(strFileLocation & "CAR.xls")
With objExlCAR.Sheets("Corrective Action")
.Cells(8, 2) = Me![Part Name]
.Cells(8, 11) = Me![Part No]
.Cells(11, 1) = Me![Quality Issue]
.Cells(17, 3) = Me![Response Due Date]
.Cells(18, 3) = Me![Name of Issuer]
End With
objExlCAR.SaveAs strFileLocation & strFileName
objExlCAR.Close
Set objExlCAR = Nothing
I am not sure how to combat this.