Convert Excel Spreadsheet

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's TIFF-XChange Printer Drivers SDK (All Versions).

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
rgoodson40
User
Posts: 7
Joined: Fri May 05, 2006 8:46 pm

Convert Excel Spreadsheet

Post by rgoodson40 » Mon Jun 19, 2006 11:26 pm

I recently purchased the Tiff Xchange version 3.2 SDK to embed in my application to convert Office files to tif files. To convert a file, I basically create a Tuner object and set the Filename to the location of the Office file and call PrintFile. Word docs work fine. My problem is with converting Excel files.

When converting an Excel Spreadsheet to a tif file, I have noticed that only the first tab in the spreadsheet gets converted. How do you convert all tabs in the spreadsheet to a tif file. Ideally, it would create 1 tif file, with each tab in the spreadsheet becoming separate pages in the tif file.

John - Tracker Supp
Site Admin
Posts: 8203
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jun 20, 2006 9:53 am

Hi,

When creating the PDF-XChange Addin for PDF output from Excel for our end user products to achieve this - we used the Excel COM interface.

We will endeavour to research this and check if it is possible - but it may be to achieve this you will also have to use the COM interface.

Regretably - if you are forced to use this - I should advise you that it took us many months of experimentation and fine tuning with the COM object to get this working as we required and we cannot pass this knowledge on as it could well compromise any advantage we may have gained from this costly process.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

rgoodson40
User
Posts: 7
Joined: Fri May 05, 2006 8:46 pm

Post by rgoodson40 » Tue Jun 20, 2006 3:56 pm

ok, please let me as soon as you find out if this can done, as converting spreadsheets to static tif files is an integral part of my application, and if this can't be done, it will probably require some sort of redesign of my application.

John - Tracker Supp
Site Admin
Posts: 8203
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jun 21, 2006 11:44 am

Hi,

We are still looking to see if there is some suitable means to achieve this without using the Office COM object - but the more we investigate - the more it looks as though you are going to have to use the COM method - can I sugegst you at least look into this now - just in case.


I suggest you start here :

http://msdn.microsoft.com/office/
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

rgoodson40
User
Posts: 7
Joined: Fri May 05, 2006 8:46 pm

Post by rgoodson40 » Wed Jun 21, 2006 9:48 pm

I have looked into the Excel COM object and it seems pretty simple. It seems like the basic logic would be something like:

Set Application = CreateObject("Excel.Application")
Set Workbook = Application.Workbooks.Open(ExcelFile)

WorksheetsCount = Workbook.Sheets.Count
Sheet = 1
Do While Sheet <= WorksheetsCount
Set Worksheet = Workbook.Worksheets(Sheet)
'Print WorkSheet to temporary file using Worksheet.Printout
'Append temporary file to final tif file
Sheet = Sheet + 1
Loop

There is also a Printout method in the Workbook object, but I don't see the ability to print the entire workbook, so that might only print the first sheet of the spreadsheet.

Unfortunately, I am not able to use these methods directly because I still need a print engine that can create the tif files and I do not have the ability to incorporate these settings with your txc tuner.

I you are able to get this to work, it would be nice if you could also imprint the name of the worksheet at the bottom of the page, in the same way that you imprint the symbol in the middle of the image for people using the unlicensed copy of Tiff Xchange. Of course, this is just a "nice to have", unlike the other issue which has somehow got to be corrected.

John - Tracker Supp
Site Admin
Posts: 8203
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Jun 22, 2006 10:37 am

Hi,
Unfortunately, I am not able to use these methods directly because I still need a print engine that can create the tif files and I do not have the ability to incorporate these settings with your txc tuner.
To be honest - I dont understand this comment - why can you not use this method - you seem to understand the process for using the Office COM object - why can you not use TIFF-XChange in this manner?

There is also an alternative DDE method

You can set default registry value in
HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Printto\ddeexec
to
[open("%1")][print(1,,,,,,,,,,,3,"%2")][close()]

Then Excel will receive that script through DDE when a workbook is being printed using TXC Tuner's PrintFile. This will cause printing the entire workbook, not only selected sheet.

HTH
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

rgoodson40
User
Posts: 7
Joined: Fri May 05, 2006 8:46 pm

Post by rgoodson40 » Thu Jun 22, 2006 7:21 pm

you were right. I was able to use Tiff XChange in conjunction with the Excel Com object. It works fine now. thanks for your help.

John - Tracker Supp
Site Admin
Posts: 8203
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Fri Jun 23, 2006 5:44 am

Excellent - pleased you got there ! :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply