Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getobject Hides Excel File 1

Status
Not open for further replies.

MinnKota

Technical User
Nov 19, 2003
166
US
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.
 
MinnKota

Have you read the VB HELP on GetObject???

You absolutely need to.

I think that there's some stuff in there that will help you solve this "problem."

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Per your suggestion, I have moved to the CreateObject function which works beautifully! Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top