PDA

View Full Version : Solved: Web Query To Jpeg w/external VBA/VBScript Code



stanl
09-23-2005, 01:09 PM
I have created a .wsc script which creates a new Excel Object, adds a workbook, clears gridlines, performs a web query and deletes hyperlinks (see attached). The result can be saved to a file, but I have been requested to keep the Application.visible = False, and export the used range to a jpeg.

I assume that means pasting the usedrange into a Chart Object then exporting the chart as .jpg... and I thought I had code that did just that...

But I'm brain dead....

Stan

stanl
09-24-2005, 07:27 AM
Figured it out.

XL-Dennis
09-24-2005, 07:59 AM
Stan,

The following will give some info about (as a future reference ;) )

http://www.mvps.org/dmcritchie/excel/xl2gif.htm

Kind regards,
Dennis

stanl
09-24-2005, 12:59 PM
Thank you Dennis;

My initial confusion was with requirement for explicit references which macros don't require. Increasingly I have requests for Excel workbooks, but free of macro code. I find .wsc files incredibly useful as vba code ports about 90% and you can include jscript. In this particular example, the user decides whether they want a workbook or a jpeg, either of which is attached to an email - Excel is essentially middleware.

Stan

XL-Dennis
09-24-2005, 02:26 PM
I find .wsc files incredibly useful as vba code ports about 90% and you can include jscript.


Hi Stan,

Sounds interesting and I'm wondering if You would like to share it with us :)

Take care,
Dennis

stanl
09-25-2005, 08:36 AM
Dennis,

Actually, I've compiled the 'script' in a 3rd party product Winbatch, and have begun a tutorial for that newsgroup. Generally, 95% of VBA code can be used in Winbatch, with the major caveat of External references, viz. cannot use ThisWorkbook. or Me.

As this is strictly a VBA forum, posting either .wsc or Winbatch code would be foreign - I may try it at WillR's blog.

Stan

XL-Dennis
09-25-2005, 10:36 AM
Stan - Thanks my friend :)

Kind regards,
Dennis