Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Excel with Basic Script
Topic Summary:
Created On: 12/16/2010 09:06 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 12/16/2010 09:06 AM
User is offline View Users Profile Print this message

Author Icon
FabioCrivelaro
Journeyman (50-99)

Posts: 58
Joined: 05/06/2010

How I use the excel session into basic script?

It's work:

 

 

Sub Main

    Application.Range("D2:G2").Select
    Application.ActiveCell.FormulaR1C1 = "RECEIVED -  XXX"
    Application.Selection.Merge
    Application.Selection.HorizontalAlignment = xlCenter
    Application.Selection.Interior.Color = 8388736
    Application.Selection.Font.ThemeColor = xlThemeColorDark1
    Application.Selection.Font.Bold = True
End Sub

 

 

But if I use this in a loop I'll receive the following error 'Object var is nothing' in second loop pass on basic script.

I think I need to use the excel session instade of 'Application', maybe like this:

 

 

Sub Main
    Session.Range("D2:G2").Select
    Session.ActiveCell.FormulaR1C1 = "RECEIVED  -  XXX"
    Session.Selection.Merge
    Session.Selection.HorizontalAlignment = xlCenter
    Session.Selection.Interior.Color = 8388736
    Session.Selection.Font.ThemeColor = xlThemeColorDark1
    Session.Selection.Font.Bold = True
End Sub

 12/16/2010 09:33 AM
User is offline View Users Profile Print this message

Author Icon
FabioCrivelaro
Journeyman (50-99)

Posts: 58
Joined: 05/06/2010

Other exemple:
    
 
Shows an error in second loop.


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


Edited: 12/20/2014 at 07:32 PM by AutoMate Discussion Moderator
 12/21/2010 03:15 PM
User is offline View Users Profile Print this message

Author Icon
Rick Johnson
AUTOMATE EMPLOYEE

Posts: 2757
Joined: 07/14/2008

Hi Fabio,

If you specify sessions instead of applications in the AML example, do you still get the error?

-------------------------
- Rick Johnson
Network Automation
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 6686 on 11/01/2020 at 01:24 AM.
There are currently 2224 guests browsing this forum, which makes a total of 2224 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog