Sign in to follow this  
Followers 0
randallc

Convert vbscript? to COM

12 posts in this topic

#1 ·  Posted (edited)

Hi,

Can anyone help convert this? - How do we move around in Excel file?

Thanks, Randall

Cells(Rows.Count, "A").End(xlUp).Select

or

    Intersect( _

      Cells.Find("*", Cells(1), xlValues, xlWhole, xlByRows, _

        xlPrevious).EntireRow, _

      Cells.Find("*", Cells(1), xlValues, xlWhole, xlByColumns, _

        xlPrevious).EntireColumn).Select

or

Selection.SpecialCells(xlCellTypeLastCell).Select

EDIT; answer for going to last cell;

    .Application.Selection.SpecialCells(11).Select ;$xlCellTypeLastCell=11

    $AddressExcel = .Application.activecell.address

Edited by randallc

Share this post


Link to post
Share on other sites



Randall,

A big part of your problem is that your examples are full of eNum values. All of the items starting with xl are actually numeric constants and they are unknow to AutoIt. Check out this post to get their values and include them in your code:

Get Application eNums

Dale

Hi,

Can anyone help convert this? - How do we move around in Excel file?

Thanks, Randall

or

or

<{POST_SNAPBACK}>


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi,

Thanks!

That "include" generator in vbs just gives me an error.

Can you generate it and post?

Can it be included in "ie.au"

Thanks, Randall

<{POST_SNAPBACK}>

No, but I'd like to find out what the errors are so that I can try to make it work for everyone.

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi,

Now it is I who does not understand!

Are you saying that you do not get any errors when you run the vbs script to generate the "include"?- If so, I would think you would have the file and could post it.

If not, then you can see the errors!

What is the problem?

Best, Randall

Share this post


Link to post
Share on other sites

I'm sorry you don't understand.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

OK!

Here is first error.

best, Randall

constantsError.JPG

<{POST_SNAPBACK}>

Thanks Randall.

I've updated the basenote for the Enum extration topic to include information on the dll dependancy. Please check it out and let me know if you continue to have trouble.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi, Dale,

Same problem.

I have Office 2003 but not that file; imported from the Web to directory where I have the .au3 file; but perhaps it need s to be registered or something?

No luck.

But i have the ONE only constant Ineeded for my script, from the website for excel constants, so it doesn't matter to me. (excel com script working OK)

Let me know if you need me to test it some other way...

Best, Randall

Share this post


Link to post
Share on other sites

I've attached sample output for Excel to the post with the VBS Enum script.

Please try registering the dll and see it it resolves the problem. If so, I'll update the instructions.

Dale

Hi, Dale,

Same problem.

I have Office 2003 but not that file; imported from the Web to directory where I have the .au3 file; but perhaps it need s to be registered or something?

No luck.

But i have the ONE only constant Ineeded for my script, from the website for excel constants, so it doesn't matter to me.  (excel com script working OK)

Let me know if you need me to test it some other way...

Best, Randall

<{POST_SNAPBACK}>


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi Dale,

Yes, I was surprised!

"regsvr32 tlbinf32.dll" in "Run" succeeded, the "vbs" script produced the constants file!

Best, Randall

<{POST_SNAPBACK}>

Thanks for sticking with this and testing Randall. I'll update the original post.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0