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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Excel cells from Access VB window

Status
Not open for further replies.

n0nick

Programmer
Apr 28, 2005
32
0
0
NO
How can I access a already made Excel file and format its cells from Access VB window? I know how to format Excel cells when I am in a Excel VB window, but how to do it from Access VB window?
 
How about:
Set fvobj_Excel = CreateObject("Excel.Application")
fvstr_WorkSheet = fvstr_filename & ".xls"
Set fvobj_spreadsheet1 = fvobj_Excel.Workbooks.OPEN(fv_strWorkSheetPath & fvstr_WorkSheet).Sheets(1)
fvobj_spreadsheet1.cells(9, 2).Value = Val(lvrs("CountofSSN").Value)
...etc.

35+ years of 'progress' -- can't we all just go wire boards again?
 
Thank you, this was that i was looking for. But how do i close the file. Beacuse after i run this code the excel file is still opened so i need to close it before i can open it to see how it looks. I have tried this code:

fvobj_Excel.Workbooks.Close and i think it's working, but i get message "Do you want to save file changes to the file Test.xls?". How can i choose to make changes without getting this messagebox?
 
Hi,
Immediately before the ...Workbooks.Close, issue a
...Workbook.Save

Wayne

35+ years of 'progress' -- can't we all just go wire boards again?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top