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

save excel document form vb

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i am new to vb and writing a application where ,i get records from access database and then store them in an excel sheet. someimes i get an 1004 error and sometimes the code works but i cannot view the ecxcel sheet after i run the program. can someone help me with this problem
 
Are you using the DoCmd.TransferSpreadsheet method? If so, you can only use an existing table or query. You cannot use SQL directly to return an exportable recordset. You can however use QueryDef to create a new query with only those records you wish to export and then use this query as the recordsource for the export. If this is to be done on a regular basis you'll want to immediately delete the query or you won't be able to create it again using CreateQueryDef.
 
no i am using MS-Access database and i am getting error
"method 'range' of object '_global' failed".
 
Are you writing your code in Access or are you using a version of Visual Basic? This is an Access forum, so I assumed you wanted VBA coding help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top