Convert Excel Spreadsheet
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
-
- User
- Posts: 7
- Joined: Fri May 05, 2006 8:46 pm
Convert Excel Spreadsheet
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.
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.
-
- Site Admin
- Posts: 8211
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
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.
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 7
- Joined: Fri May 05, 2006 8:46 pm
-
- Site Admin
- Posts: 8211
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
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/
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 7
- Joined: Fri May 05, 2006 8:46 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.
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.
-
- Site Admin
- Posts: 8211
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Hi,
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
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?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.
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 7
- Joined: Fri May 05, 2006 8:46 pm
-
- Site Admin
- Posts: 8211
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
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
Best regards
Tracker Support
http://www.tracker-software.com