Variable Excel Sheet Name Error
Posted: 20 Jun 2019, 10:27
Hello -
Goal: I want to copy a specific range from excel to the clipboard.
Problem: I get an error message saying "The Following variable name contains illegal character"
Question: How can I change this code to avoid the error messages?
All help is appreciated,
Thank you.
Goal: I want to copy a specific range from excel to the clipboard.
Problem: I get an error message saying "The Following variable name contains illegal character"
Question: How can I change this code to avoid the error messages?
Code: Select all
XL := ComObjActive("Excel.Application") ; Creates a handle to excel
vSheetName := %SheetName% ; User select the SheetName from a gui dropdown
clipboard := XL.Sheets(vSheetName).Range("BY14:BZ22") ; Clipboard copies the specific range within the SheetName
Thank you.